aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-09-21 04:01:40 +0000
committerRoland McGrath <roland@gnu.org>1995-09-21 04:01:40 +0000
commit600927014b78e4247e36bbc554c188c7a3cca40e (patch)
treecf802f95fda74fadebc8683ac1b584b527f9fbaa /misc/mntent.c
parentMon Sep 18 15:06:00 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> (diff)
downloadglibc-600927014b78e4247e36bbc554c188c7a3cca40e.tar.gz
glibc-600927014b78e4247e36bbc554c188c7a3cca40e.tar.bz2
glibc-600927014b78e4247e36bbc554c188c7a3cca40e.zip
Wed Sep 20 18:02:03 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* locale/locale.c: Include errno.h. * locale/localedef.c: Likewise. Tue Sep 19 00:02:06 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * Makefile (distclean-1): Remove config.cache, config.log, config.h. (parent-mostlyclean): Remove all flavors of the parent library. * misc/mntent.c (getmntent): Skip multiple whitespace chars between fields. * hurd/hurdstartup.c (_hurd_startup): If RPC returns EXEC_STACK_ARGS flag, get args from stack. If args on stack but have info from RPC, relocate args on stack to make space for struct hurd_startup_data. * elf/dl-object.c: Include errno.h. * posix/execvp.c: Likewise. * dirent/scandir.c: Likewise. * sysdeps/posix/system.c: Likewise. * sysdeps/generic/setenv.c: Likewise. * stdlib/msort.c: Likewise. * stdio/memstream.c: Likewise. * stdio/fclose.c: Likewise. * stdio/getdelim.c: Likewise. * stdio/setvbuf.c: Likewise. * sysdeps/ieee754/ldexp.c: Likewise. * locale/locfile-parse.c: Likewise. * stdlib/lcong48_r.c: Don't check for null argument; let it fault. * stdlib/seed48_r.c: Likewise. * stdlib/srand48_r.c: Likewise. * stdlib/jrand48_r.c: Likewise. * stdlib/nrand48_r.c: Likewise. * misc/search.h: Many decls for hsearch functions.
Diffstat (limited to 'misc/mntent.c')
-rw-r--r--misc/mntent.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/misc/mntent.c b/misc/mntent.c
index 42c20817ba..bdc6aaed79 100644
--- a/misc/mntent.c
+++ b/misc/mntent.c
@@ -53,14 +53,20 @@ getmntent (FILE *stream)
if (getline (&buf, &bufsiz, stream) < 0)
return NULL;
- head = buf;
+ head = buf + strspn (buf, " \t");
} while (head[0] == '#'); /* Skip comment lines. */
m.mnt_fsname = strsep (&head, " \t") ?: (char *) "";
+ if (head)
+ head += strspn (head, " \t");
m.mnt_dir = strsep (&head, " \t") ?: (char *) "";
+ if (head)
+ head += strspn (head, " \t");
m.mnt_type = strsep (&head, " \t") ?: (char *) "";
+ if (head)
+ head += strspn (head, " \t");
m.mnt_opts = strsep (&head, " \t") ?: (char *) "";
- switch (sscanf (head, "%d %d\n", &m.mnt_freq, &m.mnt_passno))
+ switch (head ? sscanf (head, " %d %d\n", &m.mnt_freq, &m.mnt_passno) : 0)
{
case 0:
m.mnt_freq = 0;