Summary: | commit-log-editor can call itself in an infinite loop | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Julien Chaffraix <jchaffraix> | ||||
Component: | Tools / Tests | Assignee: | Julien Chaffraix <jchaffraix> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Minor | CC: | kenneth | ||||
Priority: | P3 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Julien Chaffraix
2010-02-23 06:45:04 PST
Created attachment 49287 [details]
Proposed fix: add a isCommitLogEditor routine and check the $editor variable against it
Comment on attachment 49287 [details] Proposed fix: add a isCommitLogEditor routine and check the $editor variable against it > +sub isCommitLogEditor($) > +{ > + my $editor = shift; > + printf $editor . "\n"; > + return $editor =~ m/commit-log-editor/; > +} Wouldn't it be enough to just do this check once and not for each time you call the subroutine? (In reply to comment #2) > (From update of attachment 49287 [details]) > > > +sub isCommitLogEditor($) > > +{ > > + my $editor = shift; > > + printf $editor . "\n"; > > + return $editor =~ m/commit-log-editor/; > > +} > > Wouldn't it be enough to just do this check once and not for each time you call > the subroutine? No, as you can't predict whether $editor is the same each time you are called. The use case for that would be setting $SVN_LOG_EDITOR to commit-log-editor. If you cache the result, then you will fall all the way down to "/usr/bin/vi" when you could have used $EDITOR. Kenneth, are you satisfied with my comment or would you prefer another approach? Yes! r=me |