Module Name:    src
Committed By:   ginsbach
Date:           Sun Oct 29 01:28:46 UTC 2017

Modified Files:
        src/usr.bin/seq: seq.c

Log Message:
The sign is optional in an exponent

Treat numbers after [Ee] as a positive number rather than an invalid
numeric sequence.  (Taken from FreeBSD but done differently.)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/seq/seq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/seq/seq.c
diff -u src/usr.bin/seq/seq.c:1.9 src/usr.bin/seq/seq.c:1.10
--- src/usr.bin/seq/seq.c:1.9	Sun Oct 29 00:02:23 2017
+++ src/usr.bin/seq/seq.c	Sun Oct 29 01:28:46 2017
@@ -31,7 +31,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2005\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: seq.c,v 1.9 2017/10/29 00:02:23 ginsbach Exp $");
+__RCSID("$NetBSD: seq.c,v 1.10 2017/10/29 01:28:46 ginsbach Exp $");
 #endif /* not lint */
 
 #include <ctype.h>
@@ -211,10 +211,10 @@ numeric(const char *s)
 			}
 			if (ISEXP((unsigned char)*s)) {
 				s++;
-				if (ISSIGN((unsigned char)*s)) {
+				/* optional sign */
+				if (ISSIGN((unsigned char)*s))
 					s++;
-					continue;
-				}
+				continue;
 			}
 			break;
 		}

Reply via email to