Module Name:    src
Committed By:   christos
Date:           Fri Nov 13 16:04:58 UTC 2015

Modified Files:
        src/usr.bin/xlint/lint1: scan.l

Log Message:
Handle 0b locally since anyway this is not portable.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/xlint/lint1/scan.l

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/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.62 src/usr.bin/xlint/lint1/scan.l:1.63
--- src/usr.bin/xlint/lint1/scan.l:1.62	Thu Nov 12 12:34:01 2015
+++ src/usr.bin/xlint/lint1/scan.l	Fri Nov 13 11:04:58 2015
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.62 2015/11/12 17:34:01 christos Exp $ */
+/* $NetBSD: scan.l,v 1.63 2015/11/13 16:04:58 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.62 2015/11/12 17:34:01 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.63 2015/11/13 16:04:58 christos Exp $");
 #endif
 
 #include <stdlib.h>
@@ -522,7 +522,7 @@ icon(int base)
 {
 	int	l_suffix, u_suffix;
 	int	len;
-	const	char *cp;
+	const	char *cp, *sp;
 	char	c, *eptr;
 	tspec_t	typ;
 	uint64_t uq = 0;
@@ -569,7 +569,14 @@ icon(int base)
 
 	errno = 0;
 
-	uq = strtouq(cp, &eptr, base);
+	if (cp[0] == '0' && (cp[1] == 'b' || cp[1] == 'B')) {
+		sp = cp + 2;
+		base = 2;
+	} else {
+		sp = cp;
+	}
+
+	uq = strtouq(sp, &eptr, base);
 	if (eptr != cp + len)
 		LERROR("icon()");
 	if (errno != 0)

Reply via email to