Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/seq The sign is optional in an exponent



details:   https://anonhg.NetBSD.org/src/rev/4032f30471d8
branches:  trunk
changeset: 827457:4032f30471d8
user:      ginsbach <ginsbach%NetBSD.org@localhost>
date:      Sun Oct 29 01:28:46 2017 +0000

description:
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.)

diffstat:

 usr.bin/seq/seq.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r 468deef4ec59 -r 4032f30471d8 usr.bin/seq/seq.c
--- a/usr.bin/seq/seq.c Sun Oct 29 00:20:42 2017 +0000
+++ b/usr.bin/seq/seq.c Sun Oct 29 01:28:46 2017 +0000
@@ -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 @@
                        }
                        if (ISEXP((unsigned char)*s)) {
                                s++;
-                               if (ISSIGN((unsigned char)*s)) {
+                               /* optional sign */
+                               if (ISSIGN((unsigned char)*s))
                                        s++;
-                                       continue;
-                               }
+                               continue;
                        }
                        break;
                }



Home | Main Index | Thread Index | Old Index