diff mbox

fixinclude: shell-quote testing file

Message ID 9B70FC5D-BC2B-497A-BBE2-14FF47B76B82@adacore.com
State New
Headers show

Commit Message

Tristan Gingold May 16, 2011, 1:39 p.m. UTC
On May 16, 2011, at 3:33 PM, Bruce Korb wrote:

> On Mon, May 16, 2011 at 6:15 AM, Tristan Gingold <gingold@adacore.com> wrote:
>> Hi,
>> 
>> one of the main VMS include files has a dollar in its name (decc$types.h), which is not shell friendly.
>> 
>> As a consequence, when the name is reused by check.tpl to create a baseline file, must be quoted.
> 
>> Ok for trunk ?
> 
>> diff --git a/fixincludes/check.tpl b/fixincludes/check.tpl
>> index b239d8b..0f3937a 100644
>> --- a/fixincludes/check.tpl
>> +++ b/fixincludes/check.tpl
>> @@ -87,7 +87,7 @@ FOR fix  =][=
>>   ELSE   =]
>> -cat >> [=
>> -   IF (exist? "files") =][=
>> -      files[0] =][=
>> -   ELSE =]testing.h[=
>> -   ENDIF =] <<_HACK_EOF_
> 
> Easier would be to just single (apostrophe) quote the string:
> 
>  cat >> '[= (if (exist? "files") (get "files[0]") "testing.h")
>            =]' <<_HACK_EOF_
> 
> Or, as Andreas said after I typed the above:)
> 
>  cat >> [= (raw-shell-str (if (exist? ...))) =] <<_HACK_EOF_


Sure.  The patch below is ok for 'make check', is it also ok for you ?

Tristan.

Comments

Bruce Korb May 16, 2011, 1:42 p.m. UTC | #1
Hi Tristan,

On Mon, May 16, 2011 at 6:39 AM, Tristan Gingold <gingold@adacore.com> wrote:
> Sure.  [If] The patch below is ok for 'make check', is it also ok for you ?

Yes, thank you.
diff mbox

Patch

--- a/fixincludes/check.tpl
+++ b/fixincludes/check.tpl
@@ -85,11 +85,8 @@  FOR fix  =][=
                         (get "hackname") )) )
          =][=
   ELSE   =]
-cat >> [=
-    IF (exist? "files") =][=
-      files[0] =][=
-    ELSE =]testing.h[=
-    ENDIF =] <<_HACK_EOF_
+cat >> [= (raw-shell-str (if (exist? "files") (get "files[0]") "testing.h"))
+         =] <<_HACK_EOF_
 
 
 #if defined( [=(. HACK)=]_CHECK )