fix for replacing from underlay
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 29 Mar 2006 18:35:04 +0000 (18:35 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 29 Mar 2006 18:35:04 +0000 (18:35 +0000)
IkiWiki/CGI.pm

index 6fd1f650665bf51461c65fe66a27c46d8e28fdd0..b47c8e8038d1c1d00a4d70b3c7349610e8702b19 100644 (file)
@@ -308,10 +308,12 @@ sub cgi_editpage ($$) { #{{{
        $page=lc($page);
        
        my $file=$page.$config{default_pageext};
-       my $newfile=1;
        if (exists $pagesources{lc($page)}) {
                $file=$pagesources{lc($page)};
-               $newfile=0;
+       }
+       my $newfile=0;
+       if (! -e "$config{srcdir}/$file") {
+               $newfile=1;
        }
 
        $form->field(name => "do", type => 'hidden');