diff --git a/sys/man/6/namespace b/sys/man/6/namespace index 6c40e620c..4515df8c8 100644 --- a/sys/man/6/namespace +++ b/sys/man/6/namespace @@ -13,8 +13,7 @@ subroutines which is typically called by .IR init (8). Each line specifies one name space operation. -Spaces and tabs separate arguments to operations; -no quotes or escapes are recognized. +Spaces and tabs separate arguments to operations. Blank lines and lines with .B # as the first non-space character are ignored. diff --git a/sys/src/9/port/devproc.c b/sys/src/9/port/devproc.c index 5fb875f8a..f3761cb17 100644 --- a/sys/src/9/port/devproc.c +++ b/sys/src/9/port/devproc.c @@ -661,19 +661,19 @@ readns1(Chan *c, Proc *p, char *buf, int nbuf) if(bestmid == ~0) { c->nrock = bestmid; - i = snprint(buf, nbuf, "cd %s\n", p->dot->path->s); + i = snprint(buf, nbuf, "cd %q\n", p->dot->path->s); } else { c->nrock = bestmid+1; int2flag(cm->mflag, flag); if(strcmp(cm->to->path->s, "#M") == 0){ srv = srvname(cm->to->mchan); - i = snprint(buf, nbuf, "mount %s %s %s %s\n", flag, - srv==nil? cm->to->mchan->path->s : srv, - mh->from->path->s, cm->spec? cm->spec : ""); + i = snprint(buf, nbuf, (cm->spec && *cm->spec)? + "mount %s %q %q %q\n": "mount %s %q %q\n", flag, + srv? srv: cm->to->mchan->path->s, mh->from->path->s, cm->spec); free(srv); }else{ - i = snprint(buf, nbuf, "bind %s %s %s\n", flag, + i = snprint(buf, nbuf, "bind %s %q %q\n", flag, cm->to->path->s, mh->from->path->s); } } diff --git a/sys/src/cmd/ns.c b/sys/src/cmd/ns.c index 569009635..4e6181e20 100644 --- a/sys/src/cmd/ns.c +++ b/sys/src/cmd/ns.c @@ -90,7 +90,7 @@ main(int argc, char **argv) switch(n){ case 2: if(strcmp(av[0], "cd") == 0){ - Bprint(&stdout, "%s %s\n", av[0], av[1]); + Bprint(&stdout, "%s %s\n", av[0], quote(av[1])); continue; } /* fall through */