Subject: lib/2362: lib/libedit/makelist generates illegal characters in C header files
To: None <gnats-bugs@NetBSD.ORG>
From: None <curt@portal.ca>
List: netbsd-bugs
Date: 04/30/1996 16:47:32
>Number:         2362
>Category:       lib
>Synopsis:       lib/libedit/makelist generates illegal characters in C header files
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May  1 02:05:05 1996
>Last-Modified:
>Originator:     Curt Sampson
>Organization:
Curt Sampson    curt@portal.ca		Info at http://www.portal.ca/
Internet Portal Services, Inc.	
Vancouver, BC   (604) 257-9400		De gustibus, aut bene aut nihil.
>Release:        1.0
>Environment:
	
System: NetBSD cynic.portal.ca 1.0 NetBSD 1.0 (CYNIC) #57: Mon Apr 22 15:23:24 PDT 1996 curt@cynic.portal.ca:/usr2/src-1.0/sys/arch/i386/compile/CYNIC i386


>Description:
    lib/libedit/makelist uses the filename given on the command line to
    generate an #ifdef statement in some of the header files it creates.
    Unfortuantely, if this filename includes characters that are not allowed
    in the #ifdef statement, cc complains.
      I discovered this in 1.0, but from my examination of the -current
    source code, it appears to be present there as well.
>How-To-Repeat:
    Run the makefile with BSDSRCDIR and BSDOBJDIR in use, and have BSDSRCDIR
    have an illegal character, such as a -, in the path, so that make
    generates commands such as:
	sh /usr2/src-1.0/lib/libedit/makelist -h /usr2/src-1.0/lib/libedit/vi.c > vi.h
>Fix:
    I modified the line
	hdr="_h_`basename $1`"
    to send the output through sed to change the unwanted - to an _ in my case:
	hdr="_h_`basename $1 | sed -e 's/-/_/g'`"
    Perhaps a better solution would be to use tr to change or delete
    everything outside of a certain character range?
>Audit-Trail:
>Unformatted: