RESOLVED FIXED 35291
commit-log-editor can call itself in an infinite loop
https://bugs.webkit.org/show_bug.cgi?id=35291
Summary commit-log-editor can call itself in an infinite loop
Julien Chaffraix
Reported 2010-02-23 06:45:04 PST
if $editor ends up being commit-log-editor, it will be called in an infinite loop. I managed to get this situation by swapping SVN_EDITOR and SVN_LOG_EDITOR - by mistake - in my .bashrc file.
Attachments
Proposed fix: add a isCommitLogEditor routine and check the $editor variable against it (2.65 KB, patch)
2010-02-23 06:49 PST, Julien Chaffraix
kenneth: review+
jchaffraix: commit-queue-
Julien Chaffraix
Comment 1 2010-02-23 06:49:35 PST
Created attachment 49287 [details] Proposed fix: add a isCommitLogEditor routine and check the $editor variable against it
Kenneth Rohde Christiansen
Comment 2 2010-02-26 05:18:46 PST
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?
Julien Chaffraix
Comment 3 2010-02-26 07:17:22 PST
(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.
Julien Chaffraix
Comment 4 2010-03-17 18:18:00 PDT
Kenneth, are you satisfied with my comment or would you prefer another approach?
Kenneth Rohde Christiansen
Comment 5 2010-03-17 18:22:23 PDT
Yes! r=me
Julien Chaffraix
Comment 6 2010-03-25 07:18:26 PDT
Landed in r56540. Thanks!
Note You need to log in before you can comment on or make changes to this bug.