[PATCH] completion: Make sed command that generates config-list.h portable.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The OpenBSD 'sed' command does not support '\n' to represent newlines in
sed expressions. This leads to the follow compiler error:

    In file included from builtin/help.c:15:
    ./config-list.h:282:18: error: use of undeclared identifier 'n'
            "gitcvs.dbUser",n       "gitcvs.dbPass",
                            ^
    1 error generated.
    gmake: *** [Makefile:2821: builtin/help.o] Error 1

We can use a variable that expands to a newline to do this portably.

This portably issue was introduced in e1b81f54da (completion: take into
account the formatting backticks for options, 2025-03-19)

Signed-off-by: Collin Funk <collin.funk1@xxxxxxxxx>
---
 generate-configlist.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/generate-configlist.sh b/generate-configlist.sh
index b06da53c89..48ec8d9812 100755
--- a/generate-configlist.sh
+++ b/generate-configlist.sh
@@ -1,5 +1,8 @@
 #!/bin/sh
 
+nl='
+'
+
 SOURCE_DIR="$1"
 OUTPUT="$2"
 
@@ -19,7 +22,7 @@ EOF
 	s/::$//;
 	s/`//g;
 	s/^.*$/	"&",/;
-	s/,  */",\n	"/g;
+	s/,  */",''"$nl"''	"/g;
 	p;};
 d' \
 	    "$SOURCE_DIR"/Documentation/*config.adoc \
-- 
2.49.0





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux