spaces in pathnames

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Jun 29 19:34:54 PDT 2008


On Jun 29, 2008, at 19:18, Roland Mainz wrote:

> Jeremy Huddleston wrote:
>>
>> So I just pushed a patch to xinit that addresses some issues with
>> spaces in pathnames.  One issue remains, and I'm not sure if  
>> there's a
>> clean way to address it.  At first, I thought I could do something
>> like this:
>>
>> -    serverargs=${serverargs}" -auth "${xserverauthfile}
>> +    serverargs=${serverargs}" -auth '"${xserverauthfile}"'"

> AFAIK on any POSIX-like shell a simple...
> -- snip --
> IFS=''
> -- snip --
> ... should fix the problem.

Yeah, but then we don't get separation when we do want it:

~/src $ mya="some thing with spaces"
~/src $ myb="other spaces"
~/src $ myargs="-auth "$mya
~/src $ ./printargs "$myb" $myargs
argv[0] = ./printargs
argv[1] = other spaces
argv[2] = -auth some thing with spaces

So... back to eval as the only thing I see working, which I don't like  
(which is why I didn't commit it and actually only mentioned it as an  
afterthought to my original email).

--Jeremy



More information about the xorg mailing list