Skip to content

Commit 72c4f63

Browse files
meklortoberpar
authored andcommitted
lcov: quote tool_dir to enable paths with spaces.
Signed-off-by: Evan Lojewski <[email protected]>
1 parent 9ea42d7 commit 72c4f63

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Diff for: bin/gendesc

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use Cwd qw/abs_path/;
4444

4545
# Constants
4646
our $tool_dir = abs_path(dirname($0));
47-
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
47+
our $lcov_version = 'LCOV version '.`"$tool_dir"/get_version.sh --full`;
4848
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
4949
our $tool_name = basename($0);
5050

Diff for: bin/genhtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ use Cwd qw/abs_path cwd/;
7676
# Global constants
7777
our $title = "LCOV - code coverage report";
7878
our $tool_dir = abs_path(dirname($0));
79-
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
79+
our $lcov_version = 'LCOV version '.`"$tool_dir"/get_version.sh --full`;
8080
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
8181
our $tool_name = basename($0);
8282

Diff for: bin/geninfo

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if( $^O eq "msys" )
7070

7171
# Constants
7272
our $tool_dir = abs_path(dirname($0));
73-
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
73+
our $lcov_version = 'LCOV version '.`"$tool_dir"/get_version.sh --full`;
7474
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
7575
our $gcov_tool = "gcov";
7676
our $tool_name = basename($0);
@@ -2673,7 +2673,7 @@ sub get_gcov_version()
26732673
# Default target: x86_64-apple-darwin16.0.0
26742674
# Host CPU: haswell
26752675

2676-
open(GCOV_PIPE, "-|", "$gcov_tool --version")
2676+
open(GCOV_PIPE, "-|", "\"$gcov_tool\" --version")
26772677
or die("ERROR: cannot retrieve gcov version!\n");
26782678
local $/;
26792679
$version_string = <GCOV_PIPE>;
@@ -4479,7 +4479,7 @@ sub debug($)
44794479

44804480
sub get_gcov_capabilities()
44814481
{
4482-
my $help = `$gcov_tool --help`;
4482+
my $help = `"$gcov_tool" --help`;
44834483
my %capabilities;
44844484
my %short_option_translations = (
44854485
'a' => 'all-blocks',

Diff for: bin/genpng

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use Cwd qw/abs_path/;
3838

3939
# Constants
4040
our $tool_dir = abs_path(dirname($0));
41-
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
41+
our $lcov_version = 'LCOV version '.`"$tool_dir"/get_version.sh --full`;
4242
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
4343
our $tool_name = basename($0);
4444

Diff for: bin/get_version.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#
55
# Print lcov version or release information as provided by Git, .version
66
# or a fallback.
7-
8-
TOOLDIR=$(cd $(dirname $0) >/dev/null ; pwd)
9-
GITVER=$(cd $TOOLDIR ; git describe --tags 2>/dev/null)
7+
DIRPATH=$(dirname "$0")
8+
TOOLDIR=$(cd "$DIRPATH" >/dev/null ; pwd)
9+
GITVER=$(cd "$TOOLDIR" ; git describe --tags 2>/dev/null)
1010

1111
if [ -z "$GITVER" ] ; then
1212
# Get version information from file

Diff for: bin/lcov

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ use Cwd qw /abs_path getcwd/;
7373

7474
# Global constants
7575
our $tool_dir = abs_path(dirname($0));
76-
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
76+
our $lcov_version = 'LCOV version '.`"$tool_dir"/get_version.sh --full`;
7777
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
7878
our $tool_name = basename($0);
7979

0 commit comments

Comments
 (0)