diff options
author | joerg <joerg@FreeBSD.org> | 1995-08-15 19:40:26 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-08-15 19:40:26 +0000 |
commit | 6fad6e0e901a54523b109ca451ee49a43d5a7999 (patch) | |
tree | a3eb07a4587bd0c04c373afa69a1d7d78690b2be /usr.bin/mail | |
parent | f52d926b20c22332c8ae107c533bc6a229bc6d6a (diff) | |
download | FreeBSD-src-6fad6e0e901a54523b109ca451ee49a43d5a7999.zip FreeBSD-src-6fad6e0e901a54523b109ca451ee49a43d5a7999.tar.gz |
'#' is not a comment if a non-space char follow
Closes PR # bin/657: mail(1): comments in ~/.ma...
Submitted by: wosch@cs.tu-berlin.de (Wolfram Schneider)
Diffstat (limited to 'usr.bin/mail')
-rw-r--r-- | usr.bin/mail/lex.c | 11 | ||||
-rw-r--r-- | usr.bin/mail/mail.1 | 2 |
2 files changed, 13 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); diff --git a/usr.bin/mail/mail.1 b/usr.bin/mail/mail.1 index ecf5868..376af05 100644 --- a/usr.bin/mail/mail.1 +++ b/usr.bin/mail/mail.1 @@ -308,6 +308,8 @@ argument goes to the .Ar n Ns 'th previous message and prints it. +.It Ic \&# +ignore the remainder of the line as a comment. .It Ic \&? Prints a brief summary of commands. .It Ic \&! |