Jean-Marc Lasgouttes wrote:

> The path which is passed to edit or view is of the internal type, I
> guess. Shouldn't we do something special before putting it on the
> command line?

Yes, we should. This was already wrong before (but will hurt more often with
the full path). I simply overlooked that. Can some windows person please
confirm that the attached patch (for 1.5) works, especially for
'problematic' file names?
Maybe we should keep this in 1.5 a while before putting it into 1.4.


Georg
Index: src/format.C
===================================================================
--- src/format.C	(Revision 14145)
+++ src/format.C	(Arbeitskopie)
@@ -308,8 +308,10 @@ bool Formats::view(Buffer const & buffer
 	if (!contains(command, token_from))
 		command += ' ' + token_from;
 
-	command = subst(command, token_from, quoteName(filename));
-	command = subst(command, token_path, quoteName(onlyPath(filename)));
+	command = subst(command, token_from,
+	                quoteName(os::external_path(filename)));
+	command = subst(command, token_path,
+	                quoteName(os::external_path(onlyPath(filename))));
 	command = subst(command, token_socket, quoteName(lyxsocket->address()));
 	lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
 	buffer.message(_("Executing command: ") + command);
@@ -367,8 +369,10 @@ bool Formats::edit(Buffer const & buffer
 	if (!contains(command, token_from))
 		command += ' ' + token_from;
 
-	command = subst(command, token_from, quoteName(filename));
-	command = subst(command, token_path, quoteName(onlyPath(filename)));
+	command = subst(command, token_from,
+	                quoteName(os::external_path(filename)));
+	command = subst(command, token_path,
+	                quoteName(os::external_path(onlyPath(filename))));
 	command = subst(command, token_socket, quoteName(lyxsocket->address()));
 	lyxerr[Debug::FILES] << "Executing command: " << command << std::endl;
 	buffer.message(_("Executing command: ") + command);

Reply via email to