Skip to content
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

Runtime failure with GNU regex extensions #613

Open
AranClauson opened this issue Mar 29, 2021 · 3 comments
Open

Runtime failure with GNU regex extensions #613

AranClauson opened this issue Mar 29, 2021 · 3 comments

Comments

@AranClauson
Copy link

AranClauson commented Mar 29, 2021

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/(?<!\\)\#.*$//;
@kevina
Copy link
Member

kevina commented Mar 29, 2021

If possible please submit this as a pull request. [Edit: The changes are small enough, that a pull request is not needed.]

I can understand the fix for the MAGIC string, but \w is standard Perl. A lot of things will break if Perl no longer supports \w.

@AranClauson
Copy link
Author

AranClauson commented Mar 29, 2021 via email

@kevina
Copy link
Member

kevina commented Mar 30, 2021

It is probably a bug in Perl introduced by the changes to libc. It may be a simple matter of including REG_GNU in the regcomp flags, but that is going to introduce yet another #if.

Okay thanks.

I will fix the MAGIC string, but will leave the Perl code alone for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants