From 587e1a19609f3740cffeffc03568f2d00c8595c1a679724e9d5cac85790a0e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Sun, 14 Jun 2015 12:58:35 +0000 Subject: [PATCH] - Add printf-regress.patch to fix a printf regression boo#934175 OBS-URL: https://build.opensuse.org/package/show/shells/zsh?expand=0&rev=156 --- printf-regress.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++ zsh.changes | 5 +++++ zsh.spec | 2 ++ 3 files changed, 53 insertions(+) create mode 100644 printf-regress.patch diff --git a/printf-regress.patch b/printf-regress.patch new file mode 100644 index 0000000..ded205b --- /dev/null +++ b/printf-regress.patch @@ -0,0 +1,46 @@ +From ac26fafa03c30e8c79e4bd70bdbb68d025643ee7 Mon Sep 17 00:00:00 2001 +From: Oliver Kiddle +Date: Sun, 7 Jun 2015 23:07:26 +0200 +Subject: [PATCH] 35412: fix for - flag when formating strings with printf + +--- + ChangeLog | 5 +++++ + Src/builtin.c | 2 +- + Test/B03print.ztst | 8 ++++++-- + 3 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/Src/builtin.c b/Src/builtin.c +index 643b8c6..a3d847f 100644 +--- a/Src/builtin.c ++++ b/Src/builtin.c +@@ -4518,7 +4518,7 @@ bin_print(char *name, char **args, Options ops, int func) + lleft -= chars; + ptr += chars; + } +- if (width > 0 && flags[2]) width = -width; ++ if (width > 0 && flags[3]) width = -width; + if (width > 0 && lchars < width) + count += fprintf(fout, "%*c", width - lchars, ' '); + count += fwrite(b, 1, lbytes, fout); +diff --git a/Test/B03print.ztst b/Test/B03print.ztst +index 54d6350..eb79c4d 100644 +--- a/Test/B03print.ztst ++++ b/Test/B03print.ztst +@@ -169,11 +169,15 @@ + 0:%n count zeroed on format reuse + >1 + +-# this may fill spec string with '%0+- #*.*lld\0' - 13 characters +- printf '%1$0+- #-08.5dx\n' 123 ++# this may fill spec string with '%0'+- #*.*lld\0' - 14 characters ++ printf '%1$0'"'+- #-08.5dx\n" 123 + 0:maximal length format specification + >+00123 x + ++ printf "x:%-20s:y\n" fubar ++0:left-justification of string ++>x:fubar :y ++ + printf '%*smorning\n' -5 good + 0:negative width specified + >good morning diff --git a/zsh.changes b/zsh.changes index 5a9a2d6..9a960fa 100644 --- a/zsh.changes +++ b/zsh.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Jun 14 12:55:42 UTC 2015 - idonmez@suse.com + +- Add printf-regress.patch to fix a printf regression boo#934175 + ------------------------------------------------------------------- Sun May 31 19:15:36 UTC 2015 - idonmez@suse.com diff --git a/zsh.spec b/zsh.spec index ff67030..4ccb605 100644 --- a/zsh.spec +++ b/zsh.spec @@ -39,6 +39,7 @@ Source17: zshprompt.pl Patch1: trim-unneeded-completions.patch # PATCH-FIX-OPENSUSE zsh-osc-completion.patch -- Fix openSUSE versions in osc completion Patch2: zsh-osc-completion.patch +Patch3: printf-regress.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} Requires(pre): %{install_info_prereq} @@ -98,6 +99,7 @@ This package contains the Zsh manual in html format. %patch1 -p1 %endif %patch2 -p1 +%patch3 -p1 # Remove executable bit chmod 0644 Etc/changelog2html.pl