RoboBrainX commented on issue #3799: URL: https://github.com/apache/incubator-nuttx/issues/3799#issuecomment-853466354
Quoted from the Bash manual: > > [3.1.2.2 Single Quotes](http://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html) > > Enclosing characters in single quotes (') preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. > > [3.1.2.3 Double Quotes](http://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html) > > Enclosing characters in double quotes (") preserves the literal value of all characters within the quotes, with the exception of $, `, \, and, when history expansion is enabled, !. The characters $ and ` retain their special meaning within double quotes (see Shell Expansions). The backslash retains its special meaning only when followed by one of the following characters: $, `, ", \, or newline. Within double quotes, backslashes that are followed by one of these characters are removed. Backslashes preceding characters without a special meaning are left unmodified. A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless an ! appearing in double quotes is escaped using a backslash. The backslash preceding the ! is not removed. > So this error is expected in Cygwin w/ native ARM tools due to "\\" chars inside double quotes. A simple fix would be as follows. ``` diff --git a/tools/incdir.c b/tools/incdir.c index d2564e6502..1b363de8d1 100644 --- a/tools/incdir.c +++ b/tools/incdir.c @@ -438,11 +438,11 @@ int main(int argc, char **argv, char **envp) if (response == NULL) { - ret = my_asprintf(&segment, "%s \"%s\"", cmdarg, incpath); + ret = my_asprintf(&segment, "%s '%s'", cmdarg, incpath); } else { - ret = my_asprintf(&segment, " %s \"%s\"", cmdarg, incpath); + ret = my_asprintf(&segment, " %s '%s'", cmdarg, incpath); } } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
