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

sub bug and fix #600

Closed
pkoppstein opened this issue Oct 19, 2014 · 3 comments
Closed

sub bug and fix #600

pkoppstein opened this issue Oct 19, 2014 · 3 comments
Labels
Milestone

Comments

@pkoppstein
Copy link
Contributor

At present:

"abcdef" | sub( "^(?<head>.)"; "Head=\(.head) tail=" )

produces:

"Head=a tail="

After making the change described below, the correct result is obtained:

"Head=a tail=bcdef"

The fix:

change the last "if ... then ... else ... end" to the unconditional:

     |  $in[0:$r.offset] + s + $in[$r.offset+$r.length:]
@pkoppstein
Copy link
Contributor Author

@wtlangford -- This bug fix has been languishing for over 3 weeks, so I was hoping you might be able to make the change. It only involves three lines in builtin.c. Since it's in a regex function, it's certainly in your domain! Thanks.

@wtlangford
Copy link
Contributor

Ask and ye shall receive.

@pkoppstein
Copy link
Contributor Author

@wtlangford - Thank you! I promise to be careful what I ask for.

Meanwhile, you might like to look at #618 ...

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

No branches or pull requests

3 participants