diff options
Diffstat (limited to 'usr.bin/mail/lex.c')
-rw-r--r-- | usr.bin/mail/lex.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c index 3428203..2c7cb3e 100644 --- a/usr.bin/mail/lex.c +++ b/usr.bin/mail/lex.c @@ -458,6 +458,17 @@ lex(word) register struct cmd *cp; extern struct cmd cmdtab[]; + /* + * ignore trailing chars after `#' + * + * lines with beginning `#' are comments + * spaces befor `#' are ignored in execute() + */ + + if (*word == '#') + *(word+1) = '\0'; + + for (cp = &cmdtab[0]; cp->c_name != NOSTR; cp++) if (isprefix(word, cp->c_name)) return(cp); |