diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-04-02 12:04:56 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-04-02 13:13:39 +0200 |
commit | 54df1aa066d86d9bd04fc37c6e1fabc436ddcf2c (patch) | |
tree | 7c44229ba6b8c53038fd1f93a7941acd181a7a81 /sysui/desktop/share | |
parent | 262fae7a478dba80caff4d35651965742cb166f9 (diff) |
Fix Perl loop reading a list of file names from the command line
while (<>) { ... }
opens all the file names given on the command line in succession, and executes
the loop body once for every line read from those files. So the existing loop
processed each file over and over N times, where N is the number of lines in
that file. This appears to have been broken ever since the code's introduction
in be63ae6cba16a0e31c1388cd5e0bc418cb41afd6 "INTEGRATION: CWS networker3
(1.1.2); FILE ADDED: 2004/05/20 11:38:58 obr 1.1.2.1: #i20355#,#i20356# new
directories for system wide desktop integration".
Change-Id: I8b4f0c6812bf3ba42da4b7c55c38e52c91dd4229
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91558
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sysui/desktop/share')
-rw-r--r-- | sysui/desktop/share/brand.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sysui/desktop/share/brand.pl b/sysui/desktop/share/brand.pl index 2be723b30514..9d73e619c495 100644 --- a/sysui/desktop/share/brand.pl +++ b/sysui/desktop/share/brand.pl @@ -64,13 +64,13 @@ while ($_ = $ARGV[0], /^-/) { } -while (<>) { - unless (open INFILE,$ARGV) { - print STDOUT "Can't open input file $ARGV: $!\n"; +while ($arg = shift) { + unless (open INFILE,$arg) { + print STDOUT "Can't open input file $arg: $!\n"; exit 1; } - $srcfile = substr($ARGV, rindex($ARGV, "/") + 1); + $srcfile = substr($arg, rindex($arg, "/") + 1); unless (open OUTFILE,"> $destdir/$prefix$srcfile") { print STDOUT "Can't open output file $destdir/$prefix$srcfile: $!\n"; |