X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=klibc%2Fmakeklcc.pl;h=f8a6294db3faa72101eebf191ce78c0a074fbe64;hb=677a6a84bd16bdae229830a731800efc5de64b0f;hp=ea3f8a8256af09e0576bcbf0454be082bc41cf67;hpb=e5f053b5312a0f8d62a2bcff8ddb095052d228bc;p=elogind.git diff --git a/klibc/makeklcc.pl b/klibc/makeklcc.pl index ea3f8a825..f8a6294db 100644 --- a/klibc/makeklcc.pl +++ b/klibc/makeklcc.pl @@ -7,23 +7,16 @@ ($klccin, $klibcconf, $perlpath) = @ARGV; -# This should probably handle quotes and escapes... -sub string2list($) -{ - my($s) = @_; - - $s =~ s/\s+/\',\'/g; - return "(\'".$s."\')"; -} - print "#!${perlpath}\n"; open(KLIBCCONF, '<', $klibcconf) or die "$0: cannot open $klibcconf: $!\n"; while ( defined($l = ) ) { chomp $l; - if ( $l =~ /=/ ) { - print "\$$` = \"\Q$'\E\";\n"; - print "\@$` = ", string2list("$'"), ";\n"; + if ( $l =~ /^([^=]+)\=(.*)$/ ) { + $n = $1; $s = $2; + print "\$$n = \"\Q$s\E\";\n"; + print "\@$n = qw($s);\n"; + print "\$conf{\'\L$n\E\'} = \\\$$n;\n"; } } close(KLIBCCONF);