This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix broken 'make install-po'. Fixes PR other/7727


> > Correct me if I'm wrong, but won't the idiom you described be resistant to 
> > quoting problems? I thought quoting with 's was non-expanding.
> 
> Consider:
> 
> LIST1 = a b c
> LIST2 = `pwd`/dir $$some_shell_var
> LIST3 = 'single quotes' "double quotes"
> 
>         list=$(LIST[123]); for f in $$list ...
> 
> In the case of LIST1, picking single or double quotes doesn't matter.
> In the case of LIST2, picking single quotes would probably break.  In
> the case of LIST3, neither single nor double quotes would work.  So
> you have to be careful and actually know what the list expands to and
> how the shell is supposed to interpret it.
> 
> -- 
> Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
> CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist                Professional serial bug killer

Now I'm thinking about returning back to the other idiom, as it doesn't seem to 
have any expansion issues. Take another look and tell me why this method 
is/would be bad:

for f in .. $(FOO); do if [x$$f != x..]; then
	...
fi; done

 - Josh Martin
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]