mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-12 16:50:39 +00:00
allow from and to files to be identical for conversion (using temp file)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH-1_2_X@5698 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
02ab0cc9eb
commit
75cb5a932e
@ -1,3 +1,8 @@
|
||||
2002-11-18 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* converter.C (convert): if from and to files are the same, use a
|
||||
temporary files as intermediary
|
||||
|
||||
2002-11-19 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* lyx_main.C (queryUserLyXDir): re-run automatically the configure
|
||||
|
@ -619,6 +619,14 @@ bool Converters::convert(Buffer const * buffer,
|
||||
subst(conv.result_file,
|
||||
token_base, OnlyFilename(from_base)));
|
||||
|
||||
// if input and output files are equal, we use a
|
||||
// temporary file as intermediary (JMarc)
|
||||
string real_outfile;
|
||||
if (outfile == infile) {
|
||||
real_outfile = infile;
|
||||
outfile = AddName(buffer->tmppath, "tmpfile.out");
|
||||
}
|
||||
|
||||
if (conv.latex) {
|
||||
run_latex = true;
|
||||
string command = subst(conv.command, token_from, "");
|
||||
@ -668,6 +676,16 @@ bool Converters::convert(Buffer const * buffer,
|
||||
} else
|
||||
res = one.startscript(type, command);
|
||||
|
||||
if (!real_outfile.empty()) {
|
||||
if (!lyx::rename(outfile, real_outfile))
|
||||
res = -1;
|
||||
else
|
||||
lyxerr[Debug::FILES]
|
||||
<< "renaming file " << outfile
|
||||
<< " to " << real_outfile
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (!conv.parselog.empty()) {
|
||||
string const logfile = infile2 + ".log";
|
||||
string const script = LibScriptSearch(conv.parselog);
|
||||
|
@ -55,7 +55,7 @@ What's new
|
||||
- fix bug with citation keys that contain spaces (this was a new bug
|
||||
in 1.2.1)
|
||||
|
||||
- fix bug with handling of EPSI files (this was a new bug in 1.2.1)
|
||||
- fix bugs with handling of EPSI files (epsi handling was new in 1.2.1)
|
||||
|
||||
- fix crash with undo
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user