Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/mail treat empty variables are unset (Steffen Nurpmeso)



details:   https://anonhg.NetBSD.org/src/rev/b414698bd034
branches:  trunk
changeset: 967586:b414698bd034
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Dec 15 04:17:38 2019 +0000

description:
treat empty variables are unset (Steffen Nurpmeso)

diffstat:

 usr.bin/mail/complete.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 1337be7e9ea9 -r b414698bd034 usr.bin/mail/complete.c
--- a/usr.bin/mail/complete.c   Sun Dec 15 03:55:56 2019 +0000
+++ b/usr.bin/mail/complete.c   Sun Dec 15 04:17:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: complete.c,v 1.21 2019/12/14 20:28:02 christos Exp $   */
+/*     $NetBSD: complete.c,v 1.22 2019/12/15 04:17:38 christos Exp $   */
 
 /*-
  * Copyright (c) 1997-2000,2005,2006 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: complete.c,v 1.21 2019/12/14 20:28:02 christos Exp $");
+__RCSID("$NetBSD: complete.c,v 1.22 2019/12/15 04:17:38 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -339,7 +339,8 @@
        size_t len;
 
        if ((fname = strrchr(word, '/')) == NULL) {
-               if (word[0] == '+' && (mf = value(ENAME_FOLDER)) != NULL) {
+               if (word[0] == '+' && (mf = value(ENAME_FOLDER)) != NULL && *mf)
+               {
                        if (mf[0] == '/') {
                                (void)estrlcpy(dir, mf, sizeof(dir));
                        } else {



Home | Main Index | Thread Index | Old Index