-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
verify-examples.pl: fail verification on unescaped backslash #12589
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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. Ref: curl#12588 Closes #xxxx
bagder
approved these changes
Dec 23, 2023
For some reason the CI job |
Does it need this? diff --git a/.github/workflows/man-examples.yml b/.github/workflows/man-examples.yml
index 080cb4c2d..640e3716c 100644
--- a/.github/workflows/man-examples.yml
+++ b/.github/workflows/man-examples.yml
@@ -10,16 +10,18 @@ on:
- master
- '*/ci'
paths:
- 'docs/libcurl/curl_*.3'
- 'docs/libcurl/opts/*.3'
+ - '.github/scripts/verify-examples.pl'
pull_request:
branches:
- master
paths:
- 'docs/libcurl/curl_*.3'
- 'docs/libcurl/opts/*.3'
+ - '.github/scripts/verify-examples.pl'
jobs:
verify:
runs-on: ubuntu-latest
steps: |
oh maybe. let's find out... |
bagder
reviewed
Dec 25, 2023
How about this take? diff --git a/.github/scripts/verify-examples.pl b/.github/scripts/verify-examples.pl
index 8c8fed11b..4b4ff5810 100755
--- a/.github/scripts/verify-examples.pl
+++ b/.github/scripts/verify-examples.pl
@@ -73,10 +73,11 @@ sub extract {
print STDERR
"Error while processing file $f line $iline:\n$_" .
"Error: Single backslashes \\ are not properly shown in " .
"manpage EXAMPLE output unless they are escaped \\\\.\n";
$fail = 1;
+ $error++;
last;
}
# two backslashes become one
$_ =~ s/\\\\/\\/g;
print O $_;
@@ -95,10 +96,7 @@ for my $m (@files) {
my $out = extract($m);
if($out) {
$error |= testcompile($m);
$error |= checksrc($m);
}
- else {
- $error = 1;
- }
}
exit $error; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ref: #12588
Closes #xxxx
Note I also added
die
for failedopen
of input/output.