Allow whatnow to accept "l" as an abbreviation for "list", instead of
[mmh] / uip / whatnowsbr.c
index a5dbb2b..c370a99 100644 (file)
@@ -97,7 +97,7 @@ static struct swit aleqs[] = {
 #define        PWDCMDSW                      11
     { "pwd", 0 },
 #define        LSCMDSW                       12
-    { "ls", 0 },
+    { "ls", 2 },
 #define        ATTACHCMDSW                   13
     { "attach", 0 },
 #define        DETACHCMDSW                   14
@@ -605,6 +605,11 @@ system_in_dir(const char *dir, const char *cmd)
 {
     char olddir[BUFSIZ];
     int r;
+
+    /* ensure that $SHELL exists, as the cmd was written relying on
+       a non-blank $SHELL... */
+    setenv("SHELL","/bin/sh",0); /* don't overwrite */
+
     if (getcwd(olddir, sizeof(olddir)) == 0)
        adios("getcwd", "could not get working directory");
     if (chdir(dir) != 0)
@@ -621,6 +626,11 @@ popen_in_dir(const char *dir, const char *cmd, const char *type)
 {
     char olddir[BUFSIZ];
     FILE *f;
+
+    /* ensure that $SHELL exists, as the cmd was written relying on
+       a non-blank $SHELL... */
+    setenv("SHELL","/bin/sh",0); /* don't overwrite */
+    
     if (getcwd(olddir, sizeof(olddir)) == 0)
        adios("getcwd", "could not get working directory");
     if (chdir(dir) != 0)
@@ -1075,6 +1085,8 @@ static struct swit  sendswitches[] = {
     { "notls", TLSminc(-5) },
 #define MTSSW            47
     { "mts smtp|sendmail/smtp|sendmail/pipe", 2 },
+#define MESSAGEIDSW      48
+    { "messageid localname|random", 2 },
     { NULL, 0 }
 };
 
@@ -1252,6 +1264,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
                case USERSW:
                case PORTSW:
                case MTSSW:
+               case MESSAGEIDSW:
                    vec[vecp++] = --cp;
                    if (!(cp = *argp++) || *cp == '-') {
                        advise (NULL, "missing argument to %s", argp[-2]);