version 1.25, 2024/07/08 23:46:06
|
version 1.27, 2024/07/15 15:48:52
|
Line 388 if ($needs_inputrc_check) {
|
Line 388 if ($needs_inputrc_check) {
|
if (!-e $bash_www_cnf) { |
if (!-e $bash_www_cnf) { |
system("touch $bash_www_cnf"); |
system("touch $bash_www_cnf"); |
if (open(my $fh,'>',$bash_www_cnf)) { |
if (open(my $fh,'>',$bash_www_cnf)) { |
print $fh "set enable-bracketed-paste off\n"; |
print $fh <<'END'; |
|
$if R |
|
set enable-bracketed-paste off |
|
$endif |
|
|
|
$if maxima |
|
set enable-bracketed-paste off |
|
$endif |
|
END |
close($fh); |
close($fh); |
} else { |
} else { |
warn "**** Error: could not open $bash_www_cnf to add 'set enable-bracketed-paste to off'"; |
warn "**** Error: could not open $bash_www_cnf to add 'set enable-bracketed-paste to off'"; |
} |
} |
|
my $wwwuid = getpwnam('www'); |
|
my $wwwgid = getgrnam('www'); |
|
if ($wwwuid!=$<) { |
|
chown($wwwuid,$wwwgid,$bash_www_cnf); |
|
} |
} else { |
} else { |
my ($bracketed_paste_on,$bracketed_paste_off,@preserve); |
my (%bracketed_paste_on,%bracketed_paste_off,@preserve,$condition); |
|
$condition = ''; |
if (open(my $fh,'<',$bash_www_cnf)) { |
if (open(my $fh,'<',$bash_www_cnf)) { |
while (my $line=<$fh>) { |
while (my $line=<$fh>) { |
chomp($line); |
chomp($line); |
|
if ($line =~ /^\$if\s+(\w+)\s*$/) { |
|
if ($1 eq 'R') { |
|
$condition = 'r'; |
|
} elsif ($1 eq 'maxima') { |
|
$condition = 'maxima'; |
|
} else { |
|
$condition = 'other'; |
|
} |
|
} elsif ($line =~ /^\$endif\s*$/) { |
|
$condition = ''; |
|
} |
if ($line =~ /^\s*set\s+enable\-bracketed\-paste\s+(off|on)\s*$/) { |
if ($line =~ /^\s*set\s+enable\-bracketed\-paste\s+(off|on)\s*$/) { |
if ($1 eq 'off') { |
if ($1 eq 'off') { |
$bracketed_paste_off = 1; |
if ($condition ne '') { |
|
$bracketed_paste_off{$condition} = 1; |
|
} else { |
|
$bracketed_paste_off{all} = 1; |
|
} |
|
push(@preserve,$line); |
} else { |
} else { |
$bracketed_paste_on = 1; |
if ($condition ne '') { |
|
$bracketed_paste_on{$condition} = 1; |
|
if (($condition eq 'r') || ($condition eq 'maxima')) { |
|
push(@preserve,' set enable-bracketed-paste off'); |
|
} else { |
|
push(@preserve,$line); |
|
} |
|
} else { |
|
$bracketed_paste_on{all} = 1; |
|
push(@preserve,$line); |
|
} |
} |
} |
} else { |
} else { |
push(@preserve,$line); |
push(@preserve,$line); |
Line 410 if ($needs_inputrc_check) {
|
Line 450 if ($needs_inputrc_check) {
|
} |
} |
close($fh); |
close($fh); |
} |
} |
if ($bracketed_paste_on || !$bracketed_paste_off) { |
if (($bracketed_paste_on{r} || $bracketed_paste_on{maxima}) || |
|
(!exists($bracketed_paste_off{r}) && !exists($bracketed_paste_on{r}) && |
|
!exists($bracketed_paste_off{maxima}) && !exists($bracketed_paste_on{maxima}))) { |
if (open(my $fh,'>',$bash_www_cnf)) { |
if (open(my $fh,'>',$bash_www_cnf)) { |
print $fh "set enable-bracketed-paste off\n"; |
|
if (@preserve) { |
if (@preserve) { |
foreach my $entry (@preserve) { |
foreach my $entry (@preserve) { |
print $fh "$entry\n"; |
print $fh "$entry\n"; |
} |
} |
|
if (!exists($bracketed_paste_off{r}) && !exists($bracketed_paste_on{r})) { |
|
print $fh <<'END'; |
|
$if R |
|
set enable-bracketed-paste off |
|
$endif |
|
END |
|
} |
|
if (!exists($bracketed_paste_off{r}) && !exists($bracketed_paste_on{r})) { |
|
print $fh <<'END'; |
|
$if maxima |
|
set enable-bracketed-paste off |
|
$endif |
|
END |
|
} |
|
} else { |
|
print $fh <<'END'; |
|
$if R |
|
set enable-bracketed-paste off |
|
$endif |
|
|
|
$if maxima |
|
set enable-bracketed-paste off |
|
$endif |
|
END |
} |
} |
close($fh); |
close($fh); |
} else { |
} else { |