From: simon Date: Thu, 21 Aug 2008 21:57:45 +0000 (+0000) Subject: Add an optional separator to stringize() and use it from do_list() to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c6e3ebe5f94e1741d59c943c7bccf03db1829661;p=openbsd Add an optional separator to stringize() and use it from do_list() to match the GNU pkg-config --list-all output. ok ckuethe@ --- diff --git a/usr.bin/pkg-config/pkg-config b/usr.bin/pkg-config/pkg-config index 6dedc57e5f1..189c960b98d 100644 --- a/usr.bin/pkg-config/pkg-config +++ b/usr.bin/pkg-config/pkg-config @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $OpenBSD: pkg-config,v 1.20 2007/02/01 16:38:21 espie Exp $ +# $OpenBSD: pkg-config,v 1.21 2008/08/21 21:57:45 simon Exp $ #$CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $ # Copyright (c) 2006 Chris Kuethe @@ -323,9 +323,10 @@ sub find_config sub stringize { my $list = shift; + my $sep = shift || ','; if (defined $list) { - return join(',', @$list) + return join($sep, @$list) } else { return ''; } @@ -449,7 +450,8 @@ sub do_list $fname = basename($f, '.pc'); printf("%${x}s %s - %s\n", $fname, stringize($cfg->get_property('Name', $variables)), - stringize($cfg->get_property('Description', $variables))); + stringize($cfg->get_property('Description', $variables), + ' ')); } return $error; }