Skip to contentSkip to conversation

bin/stdc: Case-insensitive standard

PATCH In review Oskari Pirhonen 2 participants 2 messages Mar 30, 2023 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bin/stdc: Case-insensitive standard

Perform a case-insensitive match on the standard given on the cli so that the following works as expected:

    $ stdc c89 printf
             int printf(const char *format, ...);
    $ stdc C89 printf
             int printf(const char *format, ...);
---
 bin/stdc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/stdc +1 -1
index 1067cf8..5630825 100755
@@ -43,7 +43,7 @@ case $# in
 	;;
 esac;
 
-case "$1" in
+case "$(printf "%s" "$1" | tr "[:upper:]" "[:lower:]")" in
 c89)
 	libc_summ_c89 \
 	| grep_proto "$2";
Signature · 1 line
2.39.2
#1 lore raw

Hi Oskari,

Quoted 9 lines · Oskari Pirhonen

Perform a case-insensitive match on the standard given on the cli so that the following works as expected:

    $ stdc c89 printf
             int printf(const char *format, ...);
    $ stdc C89 printf
             int printf(const char *format, ...);

Patch applied. Thanks!

Quoted 9 lines
---
 bin/stdc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bin/stdc +0 -0
index 1067cf8..5630825 100755

bin/stdc case $# in · line 46

Quoted 5 lines
bin/stdc +1 -1
@@ -43,7 +43,7 @@ case $# in
 	;;
 esac;
 
-case "$1" in
+case "$(printf "%s" "$1" | tr "[:upper:]" "[:lower:]")" in

I changed this slightly, to use single quotes when possible.

Cheers,
Alex

Quoted 3 lines
bin/stdc +0 -0
 c89)
 	libc_summ_c89 \
 	| grep_proto "$2";
Signature · 2 lines
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5