+
Skip to content

Conversation

frendsick
Copy link
Contributor

Fix the logic for parsing carets (^) when used as a character class negation token. Also, the '' character is now only interpreted as an escape token if it is not already escaped.

Added tests to verify the caret parsing and escaping logic.

fixes #7880

frendsick added 4 commits May 4, 2025 15:50
We have to track if the previous character was already escaped to determine
if the '\' character should be interpreted as an escape character.
Copy link

github-actions bot commented May 4, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
@frendsick frendsick requested a review from cakebaker May 4, 2025 14:57
Copy link

github-actions bot commented May 4, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker merged commit 4ee53ac into uutils:main May 4, 2025
70 checks passed
@cakebaker
Copy link
Contributor

Thanks!

@frendsick frendsick deleted the fix/expr-negated-character-classes branch May 4, 2025 15:43
RenjiSann pushed a commit to RenjiSann/coreutils that referenced this pull request May 23, 2025
* expr: Fix regex escape logic

We have to track if the previous character was already escaped to determine
if the '\' character should be interpreted as an escape character.

* expr: Fix parsing caret (^) as character class negation token

* expr: Add tests for parsing carets in regex

* expr: Add missing semicolon

* expr: Simplify boolean assignment

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
nickorlow pushed a commit to nickorlow/coreutils that referenced this pull request Jul 17, 2025
* expr: Fix regex escape logic

We have to track if the previous character was already escaped to determine
if the '\' character should be interpreted as an escape character.

* expr: Fix parsing caret (^) as character class negation token

* expr: Add tests for parsing carets in regex

* expr: Add missing semicolon

* expr: Simplify boolean assignment

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
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.

expr: incorrectly handle regexp and breaks configure scripts

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载