Hello,

I am currently taking a closer look at the `patsubst` function in
`make`. The documentation [1] says
> Whitespace between words is folded into single space characters; leading and 
> trailing whitespace is discarded. 

I have now created a example file (see attachment):
```
code := $(patsubst ,,  int index  =  10;        // Hier wird x auf 10
gesetzt  )

beispiel_zeigen:
        echo "$(code)"

.PHONY: beispiel_zeigen
```
However, the result contains the original whitespaces:
```
echo "  char index  =  10;      // Hier wird x auf 10 gesetzt  "
  char index  =  10;    // Hier wird x auf 10 gesetzt  
```

My make version:
```
$ make --version
GNU Make 4.4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<https://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. ```

Is this a bug, an issue in the documentation or am I doing something
wrong?

I would appreciate an answer!

Regards
Marek Küthe

[1]
https://www.gnu.org/software/make/manual/html_node/Text-Functions.html

-- 
Marek Küthe
m...@mk16.de
er/ihm he/him
code := $(patsubst ,,  int index  =  10;	// Hier wird x auf 10 gesetzt  )

beispiel_zeigen:
	echo "$(code)"

.PHONY: beispiel_zeigen

Attachment: pgpAHD33syg5n.pgp
Description: OpenPGP digital signature

Reply via email to