summaryrefslogtreecommitdiffstats
path: root/support/nfs
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-06-05 12:36:52 +1000
committerNeil Brown <neilb@suse.de>2006-06-05 12:36:52 +1000
commit89572e84169557fe3c70b5de619c274ceaf7b028 (patch)
treedcc15218eb0b0d6517462740bf7f3852323b8850 /support/nfs
parentae821dcebb67784c59011f3113ba840d81ca6a45 (diff)
downloadnfs-utils-89572e84169557fe3c70b5de619c274ceaf7b028.tar.gz
nfs-utils-89572e84169557fe3c70b5de619c274ceaf7b028.tar.xz
nfs-utils-89572e84169557fe3c70b5de619c274ceaf7b028.zip
Only treat '#' as starting a comment when at the start of a token
otherwise '#' in filenames cannot be read.
Diffstat (limited to 'support/nfs')
-rw-r--r--support/nfs/xio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/support/nfs/xio.c b/support/nfs/xio.c
index 4a3f181..1ce5157 100644
--- a/support/nfs/xio.c
+++ b/support/nfs/xio.c
@@ -95,6 +95,11 @@ xgettok(XFILE *xfp, char sepa, char *tok, int len)
while (i < len && (c = xgetc(xfp)) != EOF &&
(quoted || (c != sepa && !isspace(c)))) {
+ if (!quoted && i == 0 && c == '#') {
+ c = xskipcomment(xfp);
+ xfp->x_line++;
+ break;
+ }
if (c == '"') {
quoted = !quoted;
continue;
@@ -138,8 +143,6 @@ xgetc(XFILE *xfp)
ungetc(c, xfp->x_fp);
return ' ';
}
- if (c == '#')
- c = xskipcomment(xfp);
if (c == '\n')
xfp->x_line++;
return c;