Module Name:    src
Committed By:   apb
Date:           Sun Jan 20 10:12:59 UTC 2013

Modified Files:
        src/usr.bin/sort: fields.c

Log Message:
When parsing numbers, allow a leading '+'.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/sort/fields.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/sort/fields.c
diff -u src/usr.bin/sort/fields.c:1.32 src/usr.bin/sort/fields.c:1.33
--- src/usr.bin/sort/fields.c:1.32	Sat Dec 18 23:09:48 2010
+++ src/usr.bin/sort/fields.c	Sun Jan 20 10:12:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fields.c,v 1.32 2010/12/18 23:09:48 christos Exp $	*/
+/*	$NetBSD: fields.c,v 1.33 2013/01/20 10:12:58 apb Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include "sort.h"
 
-__RCSID("$NetBSD: fields.c,v 1.32 2010/12/18 23:09:48 christos Exp $");
+__RCSID("$NetBSD: fields.c,v 1.33 2013/01/20 10:12:58 apb Exp $");
 
 #define SKIP_BLANKS(ptr) {					\
 	if (BLANK & d_mask[*(ptr)])				\
@@ -275,7 +275,10 @@ number(u_char *pos, const u_char *bufend
 	if (*line == '-') {	/* set the sign */
 		negate ^= 0xff;
 		line++;
+	} else if (*line == '+') {
+		line++;
 	}
+
 	/* eat initial zeroes */
 	for (; *line == '0' && line < lineend; line++)
 		continue;

Reply via email to