Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/sort Only process each number digit once.



details:   https://anonhg.NetBSD.org/src/rev/6cea5401f0d5
branches:  trunk
changeset: 746892:6cea5401f0d5
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Aug 22 21:19:40 2009 +0000

description:
Only process each number digit once.

diffstat:

 usr.bin/sort/fields.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r e7a0421f1900 -r 6cea5401f0d5 usr.bin/sort/fields.c
--- a/usr.bin/sort/fields.c     Sat Aug 22 18:26:42 2009 +0000
+++ b/usr.bin/sort/fields.c     Sat Aug 22 21:19:40 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fields.c,v 1.25 2009/08/22 10:53:28 dsl Exp $  */
+/*     $NetBSD: fields.c,v 1.26 2009/08/22 21:19:40 dsl Exp $  */
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #include "sort.h"
 
 #ifndef lint
-__RCSID("$NetBSD: fields.c,v 1.25 2009/08/22 10:53:28 dsl Exp $");
+__RCSID("$NetBSD: fields.c,v 1.26 2009/08/22 21:19:40 dsl Exp $");
 __SCCSID("@(#)fields.c 8.1 (Berkeley) 6/6/93");
 #endif /* not lint */
 
@@ -335,7 +335,7 @@
        for (last_nz_pos = pos; line < lineend; ) {
                if (pos >= bufend)
                        return NULL;
-               ch = *line;
+               ch = *line++;
                val = (ch - '0') * 10;
                if (val > 90) {
                        if (ch == DECIMAL_POINT && !had_dp) {



Home | Main Index | Thread Index | Old Index