Source-Changes-HG archive

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

[src/trunk]: src/bin/ps Don't assign v to newvar, so we can still access the ...



details:   https://anonhg.NetBSD.org/src/rev/b62b8d8e8a98
branches:  trunk
changeset: 1023569:b62b8d8e8a98
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Sep 15 13:16:57 2021 +0000

description:
Don't assign v to newvar, so we can still access the original length.

diffstat:

 bin/ps/keyword.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 46aa017e64fc -r b62b8d8e8a98 bin/ps/keyword.c
--- a/bin/ps/keyword.c  Wed Sep 15 11:03:24 2021 +0000
+++ b/bin/ps/keyword.c  Wed Sep 15 13:16:57 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: keyword.c,v 1.59 2021/09/14 22:01:17 christos Exp $    */
+/*     $NetBSD: keyword.c,v 1.60 2021/09/15 13:16:57 christos Exp $    */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)keyword.c  8.5 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: keyword.c,v 1.59 2021/09/14 22:01:17 christos Exp $");
+__RCSID("$NetBSD: keyword.c,v 1.60 2021/09/15 13:16:57 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -383,7 +383,6 @@
 
        struct var *newvar = emalloc(sizeof(*newvar));
        *newvar = *v;
-       v = newvar;
 
        if (hp) {
                /*
@@ -407,7 +406,7 @@
        if (*p != *pp)
                newvar->flag |= ALTPR|LJUST;
 
-       return v;
+       return newvar;
 }
 
 static int



Home | Main Index | Thread Index | Old Index