Subject: bin/5074: sup uses local read_line function instead of fparseln
To: None <gnats-bugs@gnats.netbsd.org>
From: None <haszlaki@uaccess.net>
List: netbsd-bugs
Date: 02/26/1998 00:14:18
>Number: 5074
>Category: bin
>Synopsis: sup uses local read_line function instead of fparseln
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Feb 26 11:05:03 1998
>Last-Modified:
>Originator: Eric Haszlakiewicz
>Organization:
>Release: 2/24/98
>Environment:
System: NetBSD realms.isdn.uiuc.edu 1.3C NetBSD 1.3C (REALMS) #0: Sun Feb 8 20:40:50 CST 1998 root@realms.isdn.uiuc.edu:/REALMS i386
>Description:
Look in /usr/src/usr.sbin/sup/source/{supcmain.c,read_line.c}
Notice duplication of fparseln code.
Also: man fparseln:
...
The fparseln() function first appeared in NetBSD 1.4.
...
1.4?
>How-To-Repeat:
>Fix:
Index: supcmain.c
===================================================================
RCS file: /cvs/usr/src/usr.sbin/sup/source/supcmain.c,v
retrieving revision 1.2
diff -r1.2 supcmain.c
652,653c652,653
< while ((p = read_line(f, NULL, NULL)) != NULL) {
< if (index ("#;:",*p)) continue;
---
> while ((p = fparseln(f, NULL, NULL, NULL, 0)) != NULL) {
> if (index (";:",*p)) continue;
Index: supextern.h
===================================================================
RCS file: /cvs/usr/src/usr.sbin/sup/source/supextern.h,v
retrieving revision 1.2
diff -r1.2 supextern.h
54,56d53
< /* read_line.c */
< char *read_line __P((FILE *, size_t *, int *));
<
Index: Makefile
===================================================================
RCS file: /cvs/usr/src/usr.sbin/sup/source/Makefile,v
retrieving revision 1.2
diff -r1.2 Makefile
69c69
< supcmisc.o supcmeat.o read_line.o
---
> supcmisc.o supcmeat.o
126d125
< read_line.o: supextern.h
===================================================================
RCS file: /cvs/usr/src/lib/libutil/fparseln.3,v
diff -r1.2 fparseln.3
153c153
< .Nx 1.4 .
---
> .Nx 1.3 .
>Audit-Trail:
>Unformatted: