diff --git a/bc-1.06-opt-expression.diff b/bc-1.06-opt-expression.diff new file mode 100644 index 0000000..84ba4a5 --- /dev/null +++ b/bc-1.06-opt-expression.diff @@ -0,0 +1,20 @@ +--- bc/bc.y ++++ bc/bc.y +@@ -203,7 +203,7 @@ statement : Warranty + { + if ($4 & 2) + warn ("Comparison in first for expression"); +- if ($4 >= 0) ++ if (!($4 & 16)) + generate ("p"); + $4 = next_label++; + sprintf (genstr, "N%1d:", $4); +@@ -211,7 +211,7 @@ statement : Warranty + } + opt_expression ';' + { +- if ($7 < 0) generate ("1"); ++ if ($7 & 16) generate ("1"); + $7 = next_label++; + sprintf (genstr, "B%1d:J%1d:", $7, break_label); + generate (genstr); diff --git a/bc-1.06_getopt.patch b/bc-1.06_getopt.patch index 18f2c81..57767c5 100644 --- a/bc-1.06_getopt.patch +++ b/bc-1.06_getopt.patch @@ -1,25 +1,12 @@ --- bc/main.c +++ bc/main.c -@@ -44,14 +44,14 @@ - /* long option support */ - static struct option long_options[] = - { -- {"compile", 0, &compile_only, TRUE}, -- {"help", 0, 0, 'h'}, -- {"interactive", 0, 0, 'i'}, -- {"mathlib", 0, &use_math, TRUE}, -- {"quiet", 0, &quiet, TRUE}, -- {"standard", 0, &std_only, TRUE}, -- {"version", 0, 0, 'v'}, -- {"warn", 0, &warn_not_std, TRUE}, -+ {"compile", 0, 0, 'c'}, -+ {"help", 0, 0, 'h'}, -+ {"interactive", 0, 0, 'i'}, -+ {"mathlib", 0, 0, 'l'}, -+ {"quiet", 0, 0, 'q'}, -+ {"standard", 0, 0, 's'}, -+ {"version", 0, 0, 'v'}, -+ {"warn", 0, 0, 'w'}, +@@ -93,6 +93,9 @@ parse_args (argc, argv) - {0, 0, 0, 0} - }; + switch (optch) + { ++ case 0: /* long option */ ++ break; ++ + case 'c': /* compile only */ + compile_only = TRUE; + break; diff --git a/bc.changes b/bc.changes index 9593cce..6073890 100644 --- a/bc.changes +++ b/bc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Dec 27 14:14:55 CET 2007 - schwab@suse.de + +- Fix last change. +- Fix detection of empty opt_expression in the parser. + ------------------------------------------------------------------- Tue Jun 12 14:33:31 CEST 2007 - pgajdos@suse.cz diff --git a/bc.spec b/bc.spec index 302a0f7..87ac966 100644 --- a/bc.spec +++ b/bc.spec @@ -11,14 +11,14 @@ # norootforbuild Name: bc -BuildRequires: ed flex readline-devel -URL: ftp://ftp.gnu.org/pub/gnu/bc/ -License: GNU General Public License (GPL) +BuildRequires: bison ed flex readline-devel +Url: ftp://ftp.gnu.org/pub/gnu/bc/ +License: GPL v2 or later Group: Productivity/Scientific/Math -Autoreqprov: on +AutoReqProv: on PreReq: %{install_info_prereq} Version: 1.06 -Release: 809 +Release: 838 Summary: GNU Command Line Calculator Source: %{name}-%{version}.tar.bz2 Patch: %{name}-%{version}.dif @@ -26,6 +26,7 @@ Patch1: %{name}-%{version}-flex.diff Patch2: %name-1.06-decl.diff Patch3: %name-1.06-strict-aliasing.diff Patch4: %{name}-%{version}_getopt.patch +Patch5: %{name}-%{version}-opt-expression.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -59,15 +60,16 @@ Authors: %patch2 -p1 %patch3 -p1 %patch4 +%patch5 %build autoreconf -fi -CFLAGS="$RPM_OPT_FLAGS" \ -./configure --with-readline \ - --prefix=/usr \ - --infodir=%{_infodir} \ - --mandir=%{_mandir} \ - %{_target_cpu}-suse-linux +./configure CFLAGS="$RPM_OPT_FLAGS" \ + --with-readline \ + --prefix=/usr \ + --infodir=%{_infodir} \ + --mandir=%{_mandir} \ + --build=%{_target_cpu}-suse-linux rm bc/libmath.h make @@ -94,6 +96,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %changelog +* Thu Dec 27 2007 - schwab@suse.de +- Fix last change. +- Fix detection of empty opt_expression in the parser. * Tue Jun 12 2007 - pgajdos@suse.cz - repared acceptance of some long commandline options [#282747]