From: Jay Satiro Date: Sat, 23 Dec 2023 21:45:53 +0000 (-0500) Subject: verify-examples.pl: fail verification on unescaped backslash X-Git-Tag: curl-8_6_0~167 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa2c2ab837b18c3bcb4a6ce4542ce4ed89ab5093;p=thirdparty%2Fcurl.git verify-examples.pl: fail verification on unescaped backslash - Check that all backslashes in EXAMPLE are properly escaped. eg manpage must always use `\\n` never `\n`. This is because the manpage requires we always double blackslash to show a single backslash. Prior to this change an erroneous single backslash would pass through and compile even though it would not show correctly in the manpage. Co-authored-by: Daniel Stenberg Ref: https://github.com/curl/curl/pull/12588 Closes https://github.com/curl/curl/pull/12589 --- diff --git a/.github/scripts/verify-examples.pl b/.github/scripts/verify-examples.pl index 0b750711ea..377fe8340c 100755 --- a/.github/scripts/verify-examples.pl +++ b/.github/scripts/verify-examples.pl @@ -26,6 +26,7 @@ my @files = @ARGV; my $cfile = "test.c"; my $check = "./scripts/checksrc.pl"; +my $error; if($files[0] eq "-h") { print "Usage: verify-synopsis [man pages]\n"; @@ -47,8 +48,9 @@ sub extract { my $syn = 0; my $l = 0; my $iline = 0; - open(F, "<$f"); - open(O, ">$cfile"); + my $fail = 0; + open(F, "<$f") or die "failed opening input file $f : $!"; + open(O, ">$cfile") or die "failed opening output file $cfile : $!"; print O "#include \n"; while() { $iline++; @@ -68,6 +70,15 @@ sub extract { if(/^.fi/) { last; } + if(/(?