diff options
| author | Daniel Shahaf <danielsh@apache.org> | 2019-12-24 18:25:09 +0000 |
|---|---|---|
| committer | Daniel Shahaf <danielsh@apache.org> | 2019-12-26 04:21:47 +0000 |
| commit | 525faae5498adb4b4f1c0f4657b9ef71fc31c4d6 (patch) | |
| tree | 296ad1d6ff074c755bce6feff6582dcae5143505 /Src/Modules | |
| parent | 45138: Add zformat unit tests. (diff) | |
| download | zsh-525faae5498adb4b4f1c0f4657b9ef71fc31c4d6.tar zsh-525faae5498adb4b4f1c0f4657b9ef71fc31c4d6.tar.gz zsh-525faae5498adb4b4f1c0f4657b9ef71fc31c4d6.tar.bz2 zsh-525faae5498adb4b4f1c0f4657b9ef71fc31c4d6.tar.lz zsh-525faae5498adb4b4f1c0f4657b9ef71fc31c4d6.tar.xz zsh-525faae5498adb4b4f1c0f4657b9ef71fc31c4d6.tar.zst zsh-525faae5498adb4b4f1c0f4657b9ef71fc31c4d6.zip | |
45137: zformat: Allow the specifying minimum width and a dot with an empty maximum width.
Before this commit, format specs such as '%5.s' would be printed
literally. Now, they are treated as equivalent to '%5s'.
The '.' character is not allowed to be used in specs, so there is no
incompatibility.
Diffstat (limited to 'Src/Modules')
| -rw-r--r-- | Src/Modules/zutil.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c index de5fe8034..7d9bf05d6 100644 --- a/Src/Modules/zutil.c +++ b/Src/Modules/zutil.c @@ -797,8 +797,7 @@ static char *zformat_substring(char* instr, char **specs, char **outp, if ((*s == '.' || testit) && idigit(s[1])) { for (max = 0, s++; idigit(*s); s++) max = (max * 10) + (int) STOUC(*s) - '0'; - } - else if (testit) + } else if (*s == '.' || testit) s++; if (testit && STOUC(*s)) { |
