summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6167b70)
flag to use sscanf in F specs in order to reduce image size
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 5.9
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.42
-static char SccsId[] = "@(#)readcf.c 5.8 (Berkeley) %G%";
+static char SccsId[] = "@(#)readcf.c 5.9 (Berkeley) %G%";
#endif not lint
# include "sendmail.h"
#endif not lint
# include "sendmail.h"
char *filename;
char *fmt;
{
char *filename;
char *fmt;
{
char buf[MAXLINE];
f = fopen(filename, "r");
char buf[MAXLINE];
f = fopen(filename, "r");
while (fgets(buf, sizeof buf, f) != NULL)
{
register STAB *s;
while (fgets(buf, sizeof buf, f) != NULL)
{
register STAB *s;
+ register char *p;
+# ifdef SCANF
char wordbuf[MAXNAME+1];
if (sscanf(buf, fmt, wordbuf) != 1)
continue;
char wordbuf[MAXNAME+1];
if (sscanf(buf, fmt, wordbuf) != 1)
continue;
- s = stab(wordbuf, ST_CLASS, ST_ENTER);
- setbitn(class, s->s_class);
+ p = wordbuf;
+# else SCANF
+ p = buf;
+# endif SCANF
+
+ /*
+ ** Break up the match into words.
+ */
+
+ while (*p != '\0')
+ {
+ register char *q;
+
+ /* strip leading spaces */
+ while (isspace(*p))
+ p++;
+ if (*p == '\0')
+ break;
+
+ /* find the end of the word */
+ q = p;
+ while (*p != '\0' && !isspace(*p))
+ p++;
+ if (*p != '\0')
+ *p++ = '\0';
+
+ /* enter the word in the symbol table */
+ s = stab(q, ST_CLASS, ST_ENTER);
+ setbitn(class, s->s_class);
+ }
-static char SccsId[] = "@(#)version.c 5.41 (Berkeley) %G%";
+static char SccsId[] = "@(#)version.c 5.42 (Berkeley) %G%";
-char Version[] = "5.41";
+char Version[] = "5.42";