Skip to content

Fix invalid regexp in total_geo by escaping +#443

Merged
noctuid merged 1 commit intonoctuid:masterfrom
Yttrium-32:master
Feb 24, 2026
Merged

Fix invalid regexp in total_geo by escaping +#443
noctuid merged 1 commit intonoctuid:masterfrom
Yttrium-32:master

Conversation

@Yttrium-32
Copy link
Copy Markdown
Contributor

The regex used in total_geo results in the follow error:

gawk: cmd. line:1: (FILENAME=- FNR=23) fatal: invalid regexp: ? * + or {interval} not preceded by valid subpattern: /+.*/
gawk: cmd. line:1: BEGIN {printf("%.0f", 0.01*80*)}
gawk: cmd. line:1:                               ^ syntax error
gawk: cmd. line:1: BEGIN {printf("%.0f", 0.01*55*)}
gawk: cmd. line:1:                               ^ syntax error
gawk: cmd. line:1: BEGIN {printf("%.0f", 0.01*10*)}
gawk: cmd. line:1:                               ^ syntax error

Which causes the window to not resize or position itself correctly.

This is easily fixed by escaping the + twice.

@noctuid
Copy link
Copy Markdown
Owner

noctuid commented Feb 24, 2026

What is gawk for you? The current code works fine for me (GNU Awk 5.3.2). Escaping also works, so I'm fine with this, but I'm curious why this happening for you and not me.

@Yttrium-32
Copy link
Copy Markdown
Contributor Author

I'm on GNU Awk 5.4.0, API 4.1. Seems like gawk might have changed their regex syntax?

@Yttrium-32
Copy link
Copy Markdown
Contributor Author

Yttrium-32 commented Feb 24, 2026

Checking the NEWS file for the 5.4.0 release I see this:

   This release now uses Mike Haertel's MinRX regular expression matcher
   as the default regexp engine. The old regex and dfa engines are still
   available. More detail is available in the manual, and in the file
   README_d/README.matchers. At the very least, read that file!

This is probably what's causing the problem. README.matchers does state that the old engine is still available (although it will be removed in the future) and can be used by giving a value to the GAWK_GNU_MATCHERS environment variable.

Please let me know what solution you would prefer and I'll look into it.

@noctuid
Copy link
Copy Markdown
Owner

noctuid commented Feb 24, 2026

Great, thanks for looking into this. Since this works on the old engine as well, it makes sense to go ahead and switch.

@noctuid noctuid merged commit ef658b2 into noctuid:master Feb 24, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants