aboutsummaryrefslogtreecommitdiffstats
path: root/pw.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw.c')
-rw-r--r--pw.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pw.c b/pw.c
index 681fd6d..b675a4d 100644
--- a/pw.c
+++ b/pw.c
@@ -55,6 +55,8 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
+#define twocc(ch1, ch2) (((int) (ch1)) << 8 | (ch2))
+
#ifdef __GNUC__
#define printf_attr(fmtpos, vargpos) __attribute__ ((format (printf, \
fmtpos, vargpos)))
@@ -967,7 +969,10 @@ static execode execute(pwstate *pw, char *cmd, char *resbuf,
}
}
break;
- case 's':
+ default:
+ goto badcmd;
+ } else if (cmd[0] == ':' && ntok == 1) switch (twocc(cmd[1], cmd[2])) {
+ case twocc('s', 'a'):
{
int rflg = 0;
FILE *f;