Revision: 54186
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54186&view=rev
Author:   r_weiss
Date:     2013-01-16 18:57:18 +0000 (Wed, 16 Jan 2013)
Log Message:
-----------
Fixed a bug in function "bu_getopt" in file "getopt.c". The function would 
confuse a negative number with an number option (i.e. -0 -1 ... -9).

Modified Paths:
--------------
    brlcad/trunk/src/libbu/getopt.c

Modified: brlcad/trunk/src/libbu/getopt.c
===================================================================
--- brlcad/trunk/src/libbu/getopt.c     2013-01-16 18:06:17 UTC (rev 54185)
+++ brlcad/trunk/src/libbu/getopt.c     2013-01-16 18:57:18 UTC (rev 54186)
@@ -60,6 +60,14 @@
            ++bu_optind;
            return -1;
        }
+       if (*place >= '0' && *place <= '9' && *(place+1) != '\0') {
+           /* Not an option since an option can only be a single
+            * character (a-z, A-Z, 0-9). Probably found a negative
+            * number.
+            */
+           place = EMSG;
+           return -1;
+       }
     } /* option letter okay? */
 
     bu_optopt = (int)*place++;

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612 
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to