]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
general-functions.pl: Drop unused "writehashpart" function
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 23 Mar 2024 14:36:12 +0000 (15:36 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 27 Apr 2024 17:33:31 +0000 (19:33 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/general-functions.pl

index 011223f4a2ca903d17e4ee2ef7ad0a2ded53c141..e334c6972c98c78d36798975ec1b2111736fe12c 100644 (file)
@@ -272,42 +272,6 @@ sub writehash
        close FILE;
 }
 
-sub writehashpart
-{
-       # This function replaces the given hash in the original hash by keeping the old
-       # content and just replacing the new content
-
-       my $filename = $_[0];
-       my $newhash = $_[1];
-       my %oldhash;
-       my ($var, $val);
-
-       readhash("${filename}", \%oldhash);
-
-       foreach $var (keys %$newhash){
-               $oldhash{$var}=$newhash->{$var};
-       }
-
-       # write cgi vars to the file.
-       open(FILE, ">${filename}") or die "Unable to write file $filename";
-       flock FILE, 2;
-       foreach $var (keys %oldhash)
-       {
-               if ( $var eq "__CGI__"){next;}
-               $val = $oldhash{$var};
-               # Darren Critchley Jan 17, 2003 added the following because when submitting with a graphic, the x and y
-               # location of the mouse are submitted as well, this was being written to the settings file causing
-               # some serious grief! This skips the variable.x and variable.y
-               if (!($var =~ /(.x|.y)$/)) {
-                       if ($val =~ / /) {
-                               $val = "\'$val\'"; }
-                       if (!($var =~ /^ACTION/)) {
-                               print FILE "${var}=${val}\n"; }
-               }
-       }
-       close FILE;
-}
-
 sub age {
        my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
                $atime, $mtime, $ctime, $blksize, $blocks) = stat $_[0];