]> git.lyx.org Git - features.git/commitdiff
Allow spaces in path names for LFUN_SERVER_GOTO_FILE_ROW.
authorEnrico Forestieri <forenr@lyx.org>
Tue, 22 Dec 2009 21:44:14 +0000 (21:44 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 22 Dec 2009 21:44:14 +0000 (21:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32615 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 862870c7f973ba7f97e0ceed8ef3905b1e7598b8..cbb0e38fd6971744ee4fc02cab9325307385cfcb 100644 (file)
@@ -2599,9 +2599,18 @@ bool GuiView::goToFileRow(string const & argument)
 {
        string file_name;
        int row;
-       istringstream is(argument);
-       is >> file_name >> row;
-       file_name = os::internal_path(file_name);
+       size_t i = argument.find_last_of(' ');
+       if (i != string::npos) {
+               file_name = os::internal_path(trim(argument.substr(0, i)));
+               istringstream is(argument.substr(i + 1));
+               is >> row;
+               if (is.fail())
+                       i = string::npos;
+       }
+       if (i == string::npos) {
+               LYXERR0("Wrong argument: " << argument);
+               return false;
+       }
        Buffer * buf = 0;
        string const abstmp = package().temp_dir().absFilename();
        string const realtmp = package().temp_dir().realPath();