summaryrefslogtreecommitdiff
path: root/misc/mntent_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/mntent_r.c')
-rw-r--r--misc/mntent_r.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/misc/mntent_r.c b/misc/mntent_r.c
index 43cb3f732a..6d46abbd95 100644
--- a/misc/mntent_r.c
+++ b/misc/mntent_r.c
@@ -162,14 +162,18 @@ weak_alias (__getmntent_r, getmntent_r)
while (*rp != '\0') \
if (*rp == ' ' || *rp == '\t' || *rp == '\\') \
break; \
+ else \
+ ++rp; \
\
if (*rp != '\0') \
{ \
/* In the worst case the length of the string can increase to \
founr times the current length. */ \
- char *wp = (char *) alloca (strlen (name) * 4 + 1); \
+ char *wp; \
\
rp = name; \
+ name = wp = (char *) alloca (strlen (name) * 4 + 1); \
+ \
do \
if (*rp == ' ') \
{ \
@@ -193,8 +197,6 @@ weak_alias (__getmntent_r, getmntent_r)
else \
*wp++ = *rp; \
while (*rp++ != '\0'); \
- \
- name = wp; \
} \
} while (0)