diff options
| author | Gerd Moellmann | 2001-07-20 10:02:06 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-07-20 10:02:06 +0000 |
| commit | b6a6731a9b28956748afe6fee2512da84a30e052 (patch) | |
| tree | a549a6891ec4b1b72068436abb99f18ee22deff0 /lib-src | |
| parent | 41848daa768e48702a61786ef672f0d6e11a34f5 (diff) | |
| download | emacs-b6a6731a9b28956748afe6fee2512da84a30e052.tar.gz emacs-b6a6731a9b28956748afe6fee2512da84a30e052.zip | |
(entry_match_p, header_match_p): Fix handling of null or empty
argument to prevent duplicate headers.
Diffstat (limited to 'lib-src')
| -rwxr-xr-x | lib-src/grep-changelog | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib-src/grep-changelog b/lib-src/grep-changelog index b264bdc23d6..15a3d3c99d5 100755 --- a/lib-src/grep-changelog +++ b/lib-src/grep-changelog | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #! /usr/bin/perl | 1 | #! /usr/bin/perl |
| 2 | # $Id: grep-changelog,v 1.3 2000/06/14 07:09:42 meyering Exp $ | 2 | # $Id: grep-changelog,v 1.4 2001/07/20 09:59:19 gerd Exp $ |
| 3 | 3 | ||
| 4 | # Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. | 4 | # Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. |
| 5 | # | 5 | # |
| @@ -89,6 +89,8 @@ if ($version) { | |||
| 89 | sub header_match_p ($) { | 89 | sub header_match_p ($) { |
| 90 | my $header = shift; | 90 | my $header = shift; |
| 91 | 91 | ||
| 92 | return 0 unless $header; | ||
| 93 | |||
| 92 | # No match if AUTHOR-regexp specified and doesn't match. | 94 | # No match if AUTHOR-regexp specified and doesn't match. |
| 93 | return 0 if $author && $header !~ /$author/; | 95 | return 0 if $author && $header !~ /$author/; |
| 94 | 96 | ||
| @@ -117,6 +119,8 @@ sub header_match_p ($) { | |||
| 117 | sub entry_match_p ($) { | 119 | sub entry_match_p ($) { |
| 118 | my $entry = shift; | 120 | my $entry = shift; |
| 119 | 121 | ||
| 122 | return 0 unless $entry; | ||
| 123 | |||
| 120 | if ($regexp) { | 124 | if ($regexp) { |
| 121 | return 1 if ($entry =~ /$regexp/ | 125 | return 1 if ($entry =~ /$regexp/ |
| 122 | && (!$exclude || $entry !~ $exclude)); | 126 | && (!$exclude || $entry !~ $exclude)); |