Fixed some (Linux kernel?) compatibility problem of flock(1) of a directory.
[MyWeb.git] / Web.pm
diff --git a/Web.pm b/Web.pm
index 19b9e93..ffe48c5 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -817,7 +817,7 @@ my($in,$contents,%args)=@_;
        if (!defined $contents) {
                $contents=$in;
                $contents=File::Basename::basename($contents) if $args{"basename"};
-               $contents=~s/^mailto:([-.\w]+@[-.\w]+)$/$1/;
+               $contents=~s/^mailto:([-.\w]+(?:@|\Q(at)\E)[-.\w]+)$/$1/;
                $contents=escapeHTML($contents);
                }
        $contents=~s#<a\b[^>]*>##gi;
@@ -940,7 +940,9 @@ my($cmd)=@_;
        # FIXME: &alarm, --timeout is now infinite.
        # FIXME: Try to remove bash(1).
        # FIXME: Use: @PATH_FLOCK@
-       my @argv=('flock',dir_top_abs_disk(),'bash','-c',$cmd.' >&2');
+       # Do not: dir_top_abs_disk(),
+       # to prevent: flock: cannot open lock file /home/lace/www/www.jankratochvil.net: Is a directory
+       my @argv=('flock',dir_top_abs_disk()."/WebConfig.pm",'bash','-c',$cmd.' >&2');
        print STDERR join(" ","SPAWN:",@argv)."\n";
        system @argv;
 }