Bug 51525 - bc 1.06 - getopts bugs
Bug#: 51525 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: All Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: base-system@gentoo.org Reported By: joe_bruin@hotmail.com
Component: Core system
URL: 
Summary: bc 1.06 - getopts bugs
Keywords:  
Status Whiteboard: 
Opened: 2004-05-19 19:41 0000
Description:   Opened: 2004-05-19 19:41 0000
a bug in the argument processing of 'bc' (v1.06) prevents it from properly
reading long-format options.  compare short opt "-l" versus long opt
"--mathlib" for example.  the patch below should fix it.  a spelling error has
been fixed as well.  i've submitted this patch to the bc author (over a year
ago), but the bug persists, so i hope we can at least work it out of the gentoo
distribution.

thanks,
shac ron.

--- bc/main.c   Thu May  1 00:35:46 2003
+++ bc/main.c   Thu May  1 01:24:13 2003
@@ -63,7 +63,7 @@
   printf ("usage: %s [options] [file ...]\n%s%s%s%s%s%s%s", progname,
           "  -h  --help         print this usage and exit\n",
          "  -i  --interactive  force interactive mode\n",
-         "  -l  --mathlib      use the predefine math routnes\n",
+         "  -l  --mathlib      use the predefined math routines\n",
          "  -q  --quiet        don't print initial banner\n",
          "  -s  --standard     non-standard bc constructs are errors\n",
          "  -w  --warn         warn about non-standard bc constructs\n",
@@ -127,6 +127,9 @@
          warn_not_std = TRUE;
          break;

+        case 0: /* a longopt was processed */
+          break;
+
        default:
          usage(argv[0]);
          exit (1);

------- Comment #1 From SpanKY 2005-02-10 22:13:45 0000 -------
added to bc-1.06-r6

thanks ! :)