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

title editor: Fix name-duplication regex #3637

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Jul 31, 2020

The previous version was treating the parentheses as non-optional, and could come out with no match at all if the input name lacked them, leading to a traceback instead of the expected title editor window.

The new code will guarantee that match.group(1) always has some contents, even if — in the very degenerate case — the filename is something insane like (1).svg.

(In which case, match.group(1) == '(1)' and the rest of the match groups are empty. This would result in the output filename for the copy being generated as (1) (1).svg. Which I would argue is actually more correct than / preferable to (2).svg, in that admittedly pathological case.)

The previous version was treating the parentheses as non-optional,
and could come out with no match at all for a name that lacked them.
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Aug 10, 2020

Merging this, also an unhandled failure condition observed in the wild. (And a pretty localized change, only impacting the Title Editor.)

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Aug 10, 2020

(Or, well, I would, if Travis would get its cranium out of its posterior...)

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Aug 10, 2020

I don't get why Travis just decides to hate me sometimes. 😡

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Aug 20, 2020

OK, finally convinced Travis to sort itself out. Merging quick before it breaks again. 😩

@ferdnyc ferdnyc merged commit e92ae96 into OpenShot:develop Aug 20, 2020
@ferdnyc ferdnyc deleted the fix-dup-tite-regex branch August 20, 2020 18:31
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.

1 participant