Skip to content

Runtime failure with GNU regex extensions #613

@AranClauson

Description

@AranClauson

NetBSD dropped default support for GNU extensions to the regular expressions (e.g., \w meaning [[:alnum:]_]). This causes aspell to compile, but fail at runtime. These patches replace the GNU extensions with the POSIX equivalent expression.

--- modules/filter/modes/perl.amf.orig  2021-03-28 23:50:48.613071297 +0000
+++ modules/filter/modes/perl.amf
@@ -2,7 +2,7 @@ MODE perl
 
 ASPELL >=0.60.1
 
-MAGIC /0:256:^[ \t]*\#!((\/\w*)+)\/perl/pl/pm
+MAGIC /0:256:^[ \t]*\#!((\/[[:alnum:]_]*)+)\/perl/pl/pm
 MAGIC /<noregex>/pl/pm
 
 DESCRIPTION mode for checking Perl comments and string literals
--- auto/MkSrc/ProcNativeImpl.pm.orig   2021-03-28 23:55:43.716762626 +0000
+++ auto/MkSrc/ProcNativeImpl.pm
@@ -54,7 +54,7 @@ $info{errors}{proc}{native_impl} = sub {
       die "can't find parm for \"$p\"";
     };
     my $proc_mesg = sub {
-      my @mesg = split /\%(\w+)/, $_[0];
+      my @mesg = split /\%([[:alnum:]_]+)/, $_[0];
       my $mesg = '';
       while (true) {
        my $m = shift @mesg;
--- auto/MkSrc/Read.pm.orig     2021-03-28 23:55:35.334712924 +0000
+++ auto/MkSrc/Read.pm
@@ -85,7 +85,7 @@ sub advance ( ) {
   do {
     $line = <IN>;
     return unless defined $line;
-    $in_pod = $1 if $line =~ /^\=(\w+)/;
+    $in_pod = $1 if $line =~ /^\=([[:alnum:]_]+)/;
     $line = '' if $in_pod;
     $in_pod = undef if $in_pod && $in_pod eq 'cut';
     $line =~ s/(?<!\\)\#.*$//;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions