projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
078da3a
)
In write_action_file(), reduce the scope of a fd scalar and convert an open call...
author
Fabian Keil
<fk@fabiankeil.de>
Mon, 22 Nov 2010 10:34:44 +0000
(10:34 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Mon, 22 Nov 2010 10:34:44 +0000
(10:34 +0000)
tools/uagen.pl
patch
|
blob
|
history
diff --git
a/tools/uagen.pl
b/tools/uagen.pl
index
55dc63c
..
ac64754
100755
(executable)
--- a/
tools/uagen.pl
+++ b/
tools/uagen.pl
@@
-3,7
+3,7
@@
##############################################################################################
# uagen (http://www.fabiankeil.de/sourcecode/uagen/)
#
##############################################################################################
# uagen (http://www.fabiankeil.de/sourcecode/uagen/)
#
-# $Id: uagen.pl,v 1.
7 2010/10/30 15:57:26
fabiankeil Exp $
+# $Id: uagen.pl,v 1.
8 2010/11/22 10:34:28
fabiankeil Exp $
#
# Generates a pseudo-random Firefox user agent and writes it into a Privoxy action file
# and optionally into a Mozilla prefs file. For documentation see 'perldoc uagen(.pl)'.
#
# Generates a pseudo-random Firefox user agent and writes it into a Privoxy action file
# and optionally into a Mozilla prefs file. For documentation see 'perldoc uagen(.pl)'.
@@
-257,10
+257,9
@@
sub write_action_file() {
our $action_injection;
my $action_file_content = '';
our $action_injection;
my $action_file_content = '';
- my $actionfile_fd;
if ($action_injection){
if ($action_injection){
- open(
$actionfile_fd
, $action_file)
+ open(
my $actionfile_fd, "<"
, $action_file)
or log_error "Reading action file $action_file failed!";
while (<$actionfile_fd>) {
s@(hide-accept-language\{).*?(\})@$1$accept_language$2@;
or log_error "Reading action file $action_file failed!";
while (<$actionfile_fd>) {
s@(hide-accept-language\{).*?(\})@$1$accept_language$2@;
@@
-275,7
+274,7
@@
sub write_action_file() {
$action_file_content .= sprintf " +hide-user-agent{%s} \\\n}\n/\n",
$user_agent;
}
$action_file_content .= sprintf " +hide-user-agent{%s} \\\n}\n/\n",
$user_agent;
}
- open($actionfile_fd, ">" . $action_file)
+ open(
my
$actionfile_fd, ">" . $action_file)
or log_error "Writing action file $action_file failed!";
print $actionfile_fd $action_file_content;
close($actionfile_fd);
or log_error "Writing action file $action_file failed!";
print $actionfile_fd $action_file_content;
close($actionfile_fd);