Handle multiline output from grep and don't grep for empty strings.
This commit is contained in:
parent
5a96cbfc74
commit
3de094e271
|
@ -761,27 +761,29 @@ sub process_comment
|
||||||
# FIXME: If we have no parameters, make sure we have a PARAMS: None. section
|
# FIXME: If we have no parameters, make sure we have a PARAMS: None. section
|
||||||
|
|
||||||
# Find header file
|
# Find header file
|
||||||
# FIXME: This sometimes gives the error "sh: <file>.h: Permission denied" - why?
|
|
||||||
my $h_file = "";
|
my $h_file = "";
|
||||||
|
if ($comment->{COMMENT_NAME} ne "")
|
||||||
|
{
|
||||||
my $tmp = "grep -s -l $comment->{COMMENT_NAME} @opt_header_file_list 2>/dev/null";
|
my $tmp = "grep -s -l $comment->{COMMENT_NAME} @opt_header_file_list 2>/dev/null";
|
||||||
$tmp = `$tmp`;
|
$tmp = `$tmp`;
|
||||||
my $exit_value = $? >> 8;
|
my $exit_value = $? >> 8;
|
||||||
if ($exit_value == 0)
|
if ($exit_value == 0)
|
||||||
{
|
{
|
||||||
$tmp =~ s/\n.*//;
|
$tmp =~ s/\n.*//g;
|
||||||
if ($tmp ne "")
|
if ($tmp ne "")
|
||||||
{
|
{
|
||||||
$h_file = `basename $tmp`;
|
$h_file = `basename $tmp`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
elsif ($comment->{ALT_NAME} ne "")
|
||||||
{
|
{
|
||||||
$tmp = "grep -s -l $comment->{ALT_NAME} @opt_header_file_list"." 2>/dev/null";
|
my $tmp = "grep -s -l $comment->{ALT_NAME} @opt_header_file_list"." 2>/dev/null";
|
||||||
$tmp = `$tmp`;
|
$tmp = `$tmp`;
|
||||||
$exit_value = $? >> 8;
|
my $exit_value = $? >> 8;
|
||||||
if ($exit_value == 0)
|
if ($exit_value == 0)
|
||||||
{
|
{
|
||||||
$tmp =~ s/\n.*//;
|
$tmp =~ s/\n.*//g;
|
||||||
if ($tmp ne "")
|
if ($tmp ne "")
|
||||||
{
|
{
|
||||||
$h_file = `basename $tmp`;
|
$h_file = `basename $tmp`;
|
||||||
|
|
Loading…
Reference in New Issue