bugmake - Bugs: bug #51297, Better support for escaping of...

 
 

bug #51297: Better support for escaping of function parameters

Submitted by:  Markus Elfring <elfring>
Submitted on:  Fri 23 Jun 2017 10:11:01 AM UTC  
 
Severity: 3 - NormalItem Group: Enhancement
Status: DuplicatePrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 4.2.1Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 02 Jul 2017 05:13:34 PM UTC, comment #1:

It's important to understand that in GNU make (unlike the shell, for example) splitting of arguments in function invocations is done before the arguments are expanded.

So, you don't have to worry about special characters embedded in variables making a hash of your expansion. If they're not present directly in the call, they're not special.

So for example, this works fine:

will show:

This is true of all make functions that take arguments. As a result there's very little reason to need something that will escape a string, to keep it from being interpreted by make functions.

It is useful to be able to escape whitespace and some other characters, in some contexts (but this is NOT needed to delimit arguments to make functions). But that's bug #712 as already noted, so we don't need another bug for this.

Paul D. Smith <psmith>
Project Administrator
Fri 23 Jun 2017 10:11:01 AM UTC, original submission:

The make software supports also calling functions. The handling of corresponding arguments is described a bit. A few characters are mentioned which have got a special meaning within the language that is used by the tool “make”.

I am also especially interested in the clarification under which circumstances a passed text should be treated as a single argument (or it will be processed as separate parameters as usual according to the syntax). The functionality “word splitting” can occasionally trigger special software development challenges.
I see a need to support safer data processing there.

  • Escape a string by a corresponding function call so that it is reusable as a single parameter.
  • Provide another function call which can perform the opposite transformation so that a value is split into smaller items.

How do you think about to add extra support for such data conversion in the make function library?

Markus Elfring <elfring>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by elfring (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 02 Jul 2017 05:13:34 PM UTCpsmithStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1