summaryrefslogtreecommitdiff
path: root/pwx
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2018-05-29 07:53:05 +0200
committerSven Eden <yamakuzure@gmx.net>2018-05-29 07:53:05 +0200
commit7272c8e8c21a8c91f65647b9b9d233857ba46597 (patch)
tree61d0c04b5e8fe633e38ef8a1f79954b81ff391d5 /pwx
parent7e582e6fab7ee2d5e29d23d61839928a4c365a61 (diff)
check_tree.pl: Fixed a bug that caused #else to not be unremoved in __GLIBC__ blocks.
Diffstat (limited to 'pwx')
-rwxr-xr-xpwx/check_tree.pl13
1 files changed, 5 insertions, 8 deletions
diff --git a/pwx/check_tree.pl b/pwx/check_tree.pl
index 9cf634eaa..fb2978437 100755
--- a/pwx/check_tree.pl
+++ b/pwx/check_tree.pl
@@ -28,6 +28,7 @@
# by remembering mask changes that get pruned from the hunks.
# 0.9.3 2018-05-25 sed, PrydeWorX Made check_musl() and check_name_reverts() safer. Further policy.in
# consist of XML code, and are now handled by (un)prepare_xml().
+# 0.9.4 2018-05-29 sed, PrydeWorX Fixed a bug that caused #else to not be unremoved in __GLIBC__ blocks.
#
# ========================
# === Little TODO list ===
@@ -45,7 +46,7 @@ use Try::Tiny;
# ================================================================
# === ==> ------ Help Text and Version ----- <== ===
# ================================================================
-Readonly my $VERSION => "0.9.3"; ## Please keep this current!
+Readonly my $VERSION => "0.9.4"; ## Please keep this current!
Readonly my $VERSMIN => "-" x length($VERSION);
Readonly my $PROGDIR => dirname($0);
Readonly my $PROGNAME => basename($0);
@@ -1064,7 +1065,7 @@ sub check_musl {
# Quick mask checks, we must have the intermediate states
# -------------------------------------------------------
is_mask_start($$line) and ++$in_mask_block and next;
- is_mask_else($$line) and ++$in_else_block and next;
+ is_mask_else($$line) and ++$in_else_block and substr($$line, 0, 1) = " " and next;
if (is_mask_end($$line)) {
$in_mask_block--;
$in_else_block--;
@@ -1083,13 +1084,9 @@ sub check_musl {
# Count regular #if
$$line =~ m/^-#if/ and $in_mask_block and ++$regular_ifs;
- # Switching from __GLIBC__ to else - the alternative for musl_libc.
+ # Switching from __GLIBC__ to else - not needed.
+ # (done by is_else_block() above)
# ---------------------------------------
- if ( ($$line =~ m/^-#else/ ) && $in_mask_block && !$regular_ifs) {
- substr($$line, 0, 1) = " "; ## Remove '-'
- $in_else_block++; ## Increase instead of setting this to 1.
- next;
- }
# Ending a __GLBC__ block
# ---------------------------------------