better fix to NULL q_home problem
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 11 Feb 1994 03:24:31 +0000 (19:24 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Fri, 11 Feb 1994 03:24:31 +0000 (19:24 -0800)
SCCS-vsn: usr.sbin/sendmail/src/envelope.c 8.33

usr/src/usr.sbin/sendmail/src/envelope.c

index 68f7992..c4aca1a 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)envelope.c 8.32 (Berkeley) %G%";
+static char sccsid[] = "@(#)envelope.c 8.33 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -699,9 +699,8 @@ setsender(from, e, delimptr, internal)
                if (e->e_from.q_home == NULL)
                {
                        e->e_from.q_home = getenv("HOME");
                if (e->e_from.q_home == NULL)
                {
                        e->e_from.q_home = getenv("HOME");
-                       if (e->e_from.q_home == NULL)
-                               e->e_from.q_home = "";
-                       if (strcmp(e->e_from.q_home, "/") == 0)
+                       if (e->e_from.q_home != NULL &&
+                           strcmp(e->e_from.q_home, "/") == 0)
                                e->e_from.q_home++;
                }
                e->e_from.q_uid = RealUid;
                                e->e_from.q_home++;
                }
                e->e_from.q_uid = RealUid;