Hi,

here comes another patch that fixes the problem that a directory exists with the same name as the base name of a TeX to be included (if you understand what I mean :-))

Please check and commit,

Michael

****************************

Index: reLyXmain.pl
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/reLyX/reLyXmain.pl,v
retrieving revision 1.4
diff -u -r1.4 reLyXmain.pl
--- reLyXmain.pl 2001/08/31 07:54:05 1.4
+++ reLyXmain.pl 2003/01/15 18:59:47
@@ -145,9 +145,9 @@
# Read personal syntax.default, or system-wide if there isn't a personal one
# Then read other syntax files, given by the -s option
my $default_file = "$dot_lyxdir/reLyX/$syntaxname";
-if (! -e $default_file) {
+if (! -f $default_file) {
$default_file = "$lyxdir/reLyX/$syntaxname";
- die "cannot find default syntax file $default_file" unless -e $default_file;
+ die "cannot find default syntax file $default_file" unless -f $default_file;
}
my @syntaxfiles = ($default_file);
push (@syntaxfiles, (split(/,/,$opt_s))) if defined $opt_s;
@@ -288,9 +288,9 @@
#$path .= '/' unless $path =~ /\/$/; # fix BUG in perl5.002 fileparse!

# Try adding .tex to filename if you can't find the file the user input
- unless (-e $File) {
+ unless (-f $File) {
if (! $suffix) { # didn't have a valid suffix. Try adding one
- if (-e "$File.tex") {
+ if (-f "$File.tex") {
$suffix = ".tex";
} else {
warn "\nCan't find input file $File or $File.tex\n";
@@ -322,7 +322,10 @@
# Check for files that already exist
my $lname = $PathBase . ".lyx";
if (-e $lname) {
- if ($opt_f) {
+ if (-d $lname) {
+ warn "\nLyX file $lname already exists and is a directory.\n";
+ return @return_error;
+ } elsif ($opt_f) {
warn "Will overwrite file $lname\n" if $opt_d;
} else {
warn "\nLyX file $lname already exists. Use -f to overwrite\n";

--
=======================================================================
Michael Schmitt Telefon: +49 651 97551-40
Institut für Telematik Telefax: +49 651 97551-12
Bahnhofstrasse 30-32 WWW: http://www.ti.fhg.de
D-54292 Trier E-Mail: mailto:[EMAIL PROTECTED]
=======================================================================


Reply via email to