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/b4b4cdecfe2e
branches:  trunk
changeset: 986248:b4b4cdecfe2e
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 013264976f62 -r b4b4cdecfe2e 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