From: Enrico Forestieri Date: Sat, 19 Dec 2009 19:29:53 +0000 (+0000) Subject: Fix bug #4063: LyX cannot handle apostrophe characters ' in path names X-Git-Tag: 2.0.0~4759 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5ec9d5f9566ab135a8f2f3c23d2db2ae46c32ee5;p=lyx.git Fix bug #4063: LyX cannot handle apostrophe characters ' in path names when QProcess is disabled. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32592 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index a0c8f9759e..48ba7ef785 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -130,16 +130,19 @@ string const quoteName(string const & name, quote_style style) { switch(style) { case quote_shell: - // This does not work for filenames containing " (windows) - // or ' (all other OSes). This can't be changed easily, since - // we would need to adapt the command line parser in - // Forkedcall::generateChild. Therefore we don't pass user - // filenames to child processes if possible. We store them in - // a python script instead, where we don't have these - // limitations. + // This does not work on native Windows for filenames + // containing the following characters < > : " / \ | ? * + // Moreover, it can't be made to work, as, according to + // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx + // those are reserved characters, and thus are forbidden. + // Please, also note that the command-line parser in + // ForkedCall::generateChild cannot deal with filenames + // containing " or ', therefore we don't pass user filenames + // to child processes if possible. We store them in a python + // script instead, where we don't have these limitations. #ifndef USE_QPROCESS return (os::shell() == os::UNIX) ? - '\'' + name + '\'': + '\'' + subst(name, "'", "\'\\\'\'") + '\'' : '"' + name + '"'; #else // According to the QProcess parser, a single double