is_ntfs_dotgit: match other .git files
[gitweb.git] / git-add--interactive.perl
index 7ea3591edc056d4405b1f18800ffd2d0b351f93c..daef1c14fb099261a2ee49900c1434def9d7f415 100755 (executable)
@@ -1044,7 +1044,7 @@ sub edit_hunk_manually {
 
        open $fh, '<', $hunkfile
                or die sprintf(__("failed to open hunk edit file for reading: %s"), $!);
-       my @newtext = grep { !/^$comment_line_char/ } <$fh>;
+       my @newtext = grep { !/^\Q$comment_line_char\E/ } <$fh>;
        close $fh;
        unlink $hunkfile;
 
@@ -1099,6 +1099,7 @@ sub prompt_yesno {
        while (1) {
                print colored $prompt_color, $prompt;
                my $line = prompt_single_character;
+               return undef unless defined $line;
                return 0 if $line =~ /^n/i;
                return 1 if $line =~ /^y/i;
        }