[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #64112] ...\$(...) or ...\\$(...) give unexpected result
From: |
Pascal J. Bourguignon |
Subject: |
[bug #64112] ...\$(...) or ...\\$(...) give unexpected result |
Date: |
Wed, 26 Apr 2023 04:10:43 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?64112>
Summary: ...\$(...) or ...\\$(...) give unexpected result
Group: make
Submitter: informatimago
Submitted: Wed 26 Apr 2023 08:10:40 AM UTC
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: 4.1
Operating System: None
Fixed Release: None
Triage Status: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Wed 26 Apr 2023 08:10:40 AM UTC By: Pascal J. Bourguignon
<informatimago>
1- the comments in the source code would seem to indicate that the intended
effect of \$(foo) is to disable variable expansion, ie. to return a token
\$(foo), and for \\$(foo), we should have a simple escape of the backslash,
and the variable should be expanded, so with the following example, we should
get \foofoo.
Instead, we get in both case ^Loofoo
Note: a first problem in the source is that $ is checked and processed before
a previous \ (function find_map_unquote in read.c).
$ make --version ; echo ------------------ ; cat escape-dollar.mk ; echo
------------------ ; make -k -f escape-dollar.mk
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
------------------
foo=foofoo
qux=qux$(foo)qux
bar=bar\$(foo)bar
baz=baz\\$(foo)baz
all:
@echo "foo=$(foo)"
@echo "qux=$(qux)"
@echo "bar=$(bar)"
@echo "baz=$(baz)"
------------------
foo=foofoo
qux=quxfoofooqux
bar=baroofoobar
baz=bazoofoobaz
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64112>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #64112] ...\$(...) or ...\\$(...) give unexpected result,
Pascal J. Bourguignon <=