diff options
| author | dgp <dgp@users.sourceforge.net> | 2018-03-14 18:08:55 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2018-03-14 18:08:55 (GMT) |
| commit | d0bce3e99feecf727c865701f12b9c74d2b8a35c (patch) | |
| tree | 4efb1f0020cd1e6d451c34a30e0586dd5cb4ec61 /generic/tclUtil.c | |
| parent | 43f670e530b608c214f52ccc187f4fb5756a0256 (diff) | |
| parent | 1bf60bab3cd706cba08c15df5a6a5267d918aeae (diff) | |
| download | tcl-d0bce3e99feecf727c865701f12b9c74d2b8a35c.zip tcl-d0bce3e99feecf727c865701f12b9c74d2b8a35c.tar.gz tcl-d0bce3e99feecf727c865701f12b9c74d2b8a35c.tar.bz2 | |
merge 8.6
Diffstat (limited to 'generic/tclUtil.c')
| -rw-r--r-- | generic/tclUtil.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 3fbc325..0ba6c8e 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1903,9 +1903,9 @@ TclTrim( int trimLeft; Tcl_DString bytesBuf, trimBuf; + *trimRight = 0; /* Empty strings -> nothing to do */ if ((numBytes == 0) || (numTrim == 0)) { - *trimRight = 0; return 0; } @@ -1919,8 +1919,8 @@ TclTrim( trimLeft = numBytes; } numBytes -= trimLeft; - *trimRight = 0; - if (numBytes) { + /* have to trim yet (first char was already verified within TrimLeft) */ + if (numBytes > 1) { bytes += trimLeft; *trimRight = TrimRight(bytes, numBytes, trim, numTrim); if (*trimRight > numBytes) { |
