diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2020-10-24 13:45:08 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2020-10-25 23:06:02 +0100 |
| commit | 8773f01f2b7a908af70dc06d7d00481f1c9bec44 (patch) | |
| tree | e6671737e4ee996400424a6094dd8e1b12f2a1a6 /Src/Modules/datetime.c | |
| parent | 47302: Test for print -v fix (diff) | |
| download | zsh-8773f01f2b7a908af70dc06d7d00481f1c9bec44.tar zsh-8773f01f2b7a908af70dc06d7d00481f1c9bec44.tar.gz zsh-8773f01f2b7a908af70dc06d7d00481f1c9bec44.tar.bz2 zsh-8773f01f2b7a908af70dc06d7d00481f1c9bec44.tar.lz zsh-8773f01f2b7a908af70dc06d7d00481f1c9bec44.tar.xz zsh-8773f01f2b7a908af70dc06d7d00481f1c9bec44.tar.zst zsh-8773f01f2b7a908af70dc06d7d00481f1c9bec44.zip | |
47494, 47495: Add -n option to strftime
Diffstat (limited to 'Src/Modules/datetime.c')
| -rw-r--r-- | Src/Modules/datetime.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c index 521c15a5b..085e4cc26 100644 --- a/Src/Modules/datetime.c +++ b/Src/Modules/datetime.c @@ -175,7 +175,8 @@ output_strftime(char *nam, char **argv, Options ops, UNUSED(int func)) setsparam(scalar, metafy(buffer, len, META_DUP)); } else { fwrite(buffer, 1, len, stdout); - putchar('\n'); + if (!OPT_ISSET(ops,'n')) + putchar('\n'); } zfree(buffer, bufsize); @@ -235,7 +236,7 @@ getcurrenttime(UNUSED(Param pm)) } static struct builtin bintab[] = { - BUILTIN("strftime", 0, bin_strftime, 1, 3, 0, "qrs:", NULL), + BUILTIN("strftime", 0, bin_strftime, 1, 3, 0, "nqrs:", NULL), }; static const struct gsu_integer epochseconds_gsu = |
