From: Raja R Harinath Date: Sat, 03 Jul 2010 06:21:35 GMT Subject: Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop Message-ID: <87d3v56q6o.fsf@hariville.hurrynot.org> In-Reply-To: <8YdP-GcDDflOVZnykNVIGceOm01bqeg9PDvdgIfgqUnh29RKC-6Qi8_KBVoqLIt5iyt7g1TX5l96M5KyLrfOqg@cipher.nrlssc.navy.mil> Hi, Brandon Casey writes: > ksh does not like it when the list argument is missing in a for loop. This > can happen when NO_CURL is set which causes REMOTE_CURL_ALIASES to be unset. > In this case, the for loop in the Makefile expands to look like this: > > for p in ; do > > and ksh complains like this: > > /bin/ksh: syntax error at line 15 : `;' unexpected [snip] > - { test x"$(REMOTE_CURL_ALIASES)" = x || \ > - for p in $(REMOTE_CURL_ALIASES); do \ > + remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \ > + for p in $$remote_curl_aliases; do \ I believe the idiom test x'$(foo)' = x || for p in ''$(foo); do works equally well in this case, and is less invasive. - Hari