From 004a047222f696f3d12ba71915339ec9bf577f919d979b25e6299c1c249482c7 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 23 Oct 2009 20:08:36 +0000 Subject: [PATCH] Accepting request 22902 from Base:System Copy from Base:System/mtools based on submit request 22902 from user pgajdos OBS-URL: https://build.opensuse.org/request/show/22902 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mtools?expand=0&rev=13 --- mtools-4.0.10-help-flag.diff | 47 ++++++++++++++++++++++++++++++++++++ mtools.changes | 6 +++++ mtools.spec | 4 ++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 mtools-4.0.10-help-flag.diff diff --git a/mtools-4.0.10-help-flag.diff b/mtools-4.0.10-help-flag.diff new file mode 100644 index 0000000..9e49a53 --- /dev/null +++ b/mtools-4.0.10-help-flag.diff @@ -0,0 +1,47 @@ +diff -upr mtools-4.0.10/mattrib.c mtools-4.0.10.new/mattrib.c +--- mtools-4.0.10/mattrib.c 2009-03-03 07:10:13.000000000 +0100 ++++ mtools-4.0.10.new/mattrib.c 2009-10-23 09:07:45.000000000 +0200 +@@ -168,6 +168,7 @@ void mattrib(int argc, char **argv, int + int concise; + int replay; + char *ptr; ++ int wantUsage; + + arg.add = 0; + arg.remove = 0xff; +@@ -176,11 +177,16 @@ void mattrib(int argc, char **argv, int + view = 0; + concise = 0; + replay = 0; ++ ++ wantUsage = 0; + + if(helpFlag(argc, argv)) + usage(0); +- while ((c = getopt(argc, argv, "i:/ahrsAHRSXph")) != EOF) { ++ while ((c = getopt(argc, argv, "i:/ahrsAHRSXp")) != EOF) { + switch (c) { ++ case 'h': ++ wantUsage = 1; ++ /* FALL TROUGH */ + default: + arg.remove &= ~letterToCode(c); + break; +@@ -196,13 +202,15 @@ void mattrib(int argc, char **argv, int + case 'X': + concise = 1; + break; +- case 'h': +- usage(0); + case '?': + usage(1); + } + } + ++ if(optind == argc && wantUsage) { ++ usage(0); ++ } ++ + for(;optind < argc;optind++) { + switch(argv[optind][0]) { + case '+': diff --git a/mtools.changes b/mtools.changes index 1a4ddbd..a40b3e6 100644 --- a/mtools.changes +++ b/mtools.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 23 11:25:37 CEST 2009 - pgajdos@suse.cz + +- fixed wrong -h flag [bnc#548449] + * help-flag.diff + ------------------------------------------------------------------- Tue Sep 15 09:54:02 CEST 2009 - pgajdos@suse.cz diff --git a/mtools.spec b/mtools.spec index ef25a39..044d043 100644 --- a/mtools.spec +++ b/mtools.spec @@ -21,7 +21,7 @@ Name: mtools BuildRequires: libpng texlive-latex xorg-x11 xorg-x11-devel Version: 4.0.10 -Release: 4 +Release: 5 AutoReqProv: on Group: System/Filesystems License: GPL v3 or later @@ -36,6 +36,7 @@ Patch4: %{name}-%{version}-fat-bits.diff Patch5: %{name}-%{version}-prototypes.diff Patch6: %{name}-%{version}-overflow.diff Patch7: %{name}-%{version}-file-close.diff +Patch8: %{name}-%{version}-help-flag.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -99,6 +100,7 @@ Authors: %patch5 %patch6 %patch7 +%patch8 -p1 %build %{suse_update_config -f}