Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/join Small bug fixes:



details:   https://anonhg.NetBSD.org/src/rev/7161c18b9384
branches:  trunk
changeset: 487653:7161c18b9384
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Sat Jun 10 19:15:15 2000 +0000

description:
Small bug fixes:
* Allow , as a separator in the output field list.
* If we try to compare two fields that are not present in *either* file,
  consider it a match.

diffstat:

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

diffs (36 lines):

diff -r ebc50a91e6c8 -r 7161c18b9384 usr.bin/join/join.c
--- a/usr.bin/join/join.c       Sat Jun 10 19:03:22 2000 +0000
+++ b/usr.bin/join/join.c       Sat Jun 10 19:15:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: join.c,v 1.17 2000/06/10 19:03:22 mycroft Exp $        */
+/*     $NetBSD: join.c,v 1.18 2000/06/10 19:15:15 mycroft Exp $        */
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -48,7 +48,7 @@
 #if 0
 static char sccsid[] = "from: @(#)join.c       5.1 (Berkeley) 11/18/91";
 #else
-__RCSID("$NetBSD: join.c,v 1.17 2000/06/10 19:03:22 mycroft Exp $");
+__RCSID("$NetBSD: join.c,v 1.18 2000/06/10 19:15:15 mycroft Exp $");
 #endif
 #endif /* not lint */
 
@@ -390,7 +390,7 @@
 {
 
        if (lp1->fieldcnt <= fieldno1)
-               return (lp2->fieldcnt < fieldno2 ? 0 : 1);
+               return (lp2->fieldcnt <= fieldno2 ? 0 : 1);
        if (lp2->fieldcnt <= fieldno2)
                return (-1);
        return (strcmp(lp1->fields[fieldno1], lp2->fields[fieldno2]));
@@ -508,7 +508,7 @@
        u_long fieldno;
        char *end, *token;
 
-       while ((token = strsep(&option, " \t")) != NULL) {
+       while ((token = strsep(&option, ", \t")) != NULL) {
                if (*token == '\0')
                        continue;
                if ((token[0] != '1' && token[0] != '2') || token[1] != '.')



Home | Main Index | Thread Index | Old Index