From wosch@mail.cs.tu-berlin.de  Sun Aug  6 17:19:16 1995
Received: from mail.cs.tu-berlin.de (mail.cs.tu-berlin.de [130.149.17.13])
          by freefall.cdrom.com (8.6.11/8.6.6) with ESMTP id RAA22595
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 6 Aug 1995 17:19:12 -0700
Received: from localhost.cs.tu-berlin.de ([130.149.1.128]) by mail.cs.tu-berlin.de (8.6.12/8.6.12) with ESMTP id CAA11383 for <FreeBSD-gnats-submit@freebsd.org>; Mon, 7 Aug 1995 02:16:02 +0200
Received: (from wosch@localhost) by localhost (8.6.9/8.6.9) id RAA02968; Sun, 6 Aug 1995 17:03:49 +0200
Message-Id: <199508061503.RAA02968@localhost>
Date: Sun, 6 Aug 1995 17:03:49 +0200
From: Wolfram Schneider <wosch@cs.tu-berlin.de>
Reply-To: wosch@cs.tu-berlin.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: mail(1): comments in ~/.mailrc
X-Send-Pr-Version: 3.2

>Number:         657
>Category:       bin
>Synopsis:       mail(1): comments in ~/.mailrc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug  6 17:20:01 PDT 1995
>Closed-Date:    Tue Aug 15 21:40:29 MET DST 1995
>Last-Modified:  Tue Aug 15 21:42:13 MET DST 1995
>Originator:     Wolfram Schneider
>Release:        FreeBSD 2.0-ALPHA i386
>Organization:
>Environment:

	

>Description:

	'#' is not a comment if a non-space char follow

>How-To-Repeat:

	$ echo '#foo' >> ~/.mailrc
	$ echo foo | mail /dev/null
	Unknown command: "#foo"

>Fix:
	

--- 1.1	1995/08/06 11:39:22
+++ lex.c	1995/08/06 12:03:10
@@ -458,6 +458,17 @@
 	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);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Tue Aug 15 21:40:29 MET DST 1995 
State-Changed-Why:  
Suggested fix applied in: 
Checking in lex.c; 
/home/ncvs/src/usr.bin/mail/lex.c,v  <--  lex.c 
new revision: 1.2; previous revision: 1.1 
done 

>Unformatted:
 
