... which may cause problems if I also have a file name A.C.lyx
Hello,
is that a bug? Could it have to do with the following code at
yx-1.1.4pre2/src/support/filetools.C:903
======================================================================
string ChangeExtension(string const & oldname, string const & extension,
bool no_path)
{
string::size_type last_slash = oldname.rfind('/');
string::size_type last_dot;
if (last_slash != string::npos)
last_dot = oldname.find('.', last_slash);
// Note : I checked that changing this line to
//
// last_dot = oldname.rfind('.');
//
// make the exported file be "A.B.ps". But that may
// break some other things ... Sorry, I do not know
// the behavior of rfind() and find() when nothing is
// found, so I cannot fix the problem for sure.
else
last_dot = oldname.rfind('.');
string ext;
// Make sure the extension starts with a dot
if (!extension.empty() && extension[0] != '.')
ext= '.' + extension;
else
ext = extension;
string ret_str;
if (no_path && last_slash != string::npos) {
++last_slash; // step it
ret_str = oldname.substr(last_slash,
last_dot - last_slash) + ext;
} else
ret_str = oldname.substr(0, last_dot) + ext;
return CleanupPath(ret_str);
}
======================================================================
Cheers,
Etienne