Subject: Re: pathname with spaces causes problems for tcsh
From: Bob McGowan <[email-masked]>
To: Christos Zoulas <[email-masked]>
Cc: [email-masked], Steve Kelem <[email-masked]>, Cygwin <[email-masked]>
Date: Tue, 21 Mar 2000 13:58:58 -0800

I have the CD 1.0 with the same version of tcsh as the original poster. 
If I use double quotes around the path with spaces, there seems to be no
problem.  When I use a backslash to escape the spaces in the pathname, I
also have no problem.

But I did notice that the original poster gave the path name as /c/...
and I am wondering if the problem seen relates to this.  When I used the
//c/dir... format to change to "Multimedia Files" and typed pwd, it
printed out "/cygdrive/c/Multimedia Files" (expected) but "echo $PWD"
printed "/c/Multimedia Files".  This is clearly not correct.  The tests
I mentioned above used pathnames beginning with /cygpath/c/...  When I
repeated the tests using the //c... path name, the following happens:

   pushd "$PWD"  # errors with "no such file or directory"
   pushd $PWD    # errors with "pushd:  Too many arguments."

My only issue is that I cannot reproduce the setenv error mentioned in
the original post, nor can I get it to "work" with $PWD when I use "cd
//c/dir..." to change to the pathname with spaces.

So, spaces can be a problem but once input (through some quoting
mechanism), things should work, since the system now has a single null
terminated string to work with.  The spaces would only be problematic a
second time if they were passed in such a way that the string was
re-parsed by the shell as if it were a complete command line (or at
least an argument list).

Christos Zoulas wrote:
> 
> On Mar 21, 12:52pm, [email-masked] (Earnie Boyd) wrote:
> -- Subject: Re: pathname with spaces causes problems for tcsh
> 
> | Pathnames with spaces are a problem, period.  By the time that pushd got the
> | argument the backslashes had been removed and pushd passed to setenv more than
> | one argument thus the complaint.
> |
> | You'll have to modify the source of tcsh to fix this problem.
> |
> | Earnie.
> |
> | P.S.: This problem would exist on UNIX if the directory contained spaces.
> 
> No it would not. chdir("foo bar") works fine as well as
> setenv/putenv("foo bar", "bar baz"). The problem is in the way
> the interface call to the win32 setenv is implemented.
> 
> christos
> 
> --
> Want to unsubscribe from this list?
> Send a message to [email-masked]

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
[email-masked]

--
Want to unsubscribe from this list?
Send a message to [email-masked]