Hi,

on debugging a crash in ksh93u+ 2012-08-01 and above I've detected
an side effect which cause trouble due not initialized variables
in libast/misc/optget.c.  This is fixed in the patch found in the
attachment.  Beside this it clearifies the meaning of the variable
n as otherwise the gcc will always trow out a lot of warnings.


     Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
--- src/lib/libast/misc/optget.c
+++ src/lib/libast/misc/optget.c	2013-01-28 14:52:53.000000000 +0000
@@ -4367,9 +4367,9 @@ optget(register char** argv, const char*
 	 */
 
 	opt_info.assignment = 0;
-	num = 1;
-	w = v = 0;
-	x = 0;
+	nov = no = num = 1;
+	e = w = v = 0;
+	n = x = 0;
 	for (;;)
 	{
 		if (!opt_info.offset)
@@ -5214,7 +5214,7 @@ optget(register char** argv, const char*
 
 	if (opt_info.num != LONG_MIN)
 		opt_info.num = (long)(opt_info.number = num);
-	if ((n = *++s == '#') || *s == ':' || w && !nov && v && (optnumber(v, &e, NiL), n = !*e))
+	if ((n = (*++s == '#')) || *s == ':' || w && !nov && v && (optnumber(v, &e, NiL), n = !*e))
 	{
 		if (w)
 		{
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to