]> git.lyx.org Git - lyx.git/blobdiff - src/support/forkedcall.C
Remove executable status info from typeIndicator.
[lyx.git] / src / support / forkedcall.C
index 188019d2d285a22c64f15b41d28b4dc458f281e6..10431ffb7eadade8b3be2bf230921d3bbf1c2fab 100644 (file)
 
 #include <config.h>
 
-#include "forkedcall.h"
-#include "forkedcontr.h"
-#include "lstrings.h"
-#include "lyxlib.h"
-#include "filetools.h"
-#include "os.h"
+#include "support/forkedcall.h"
+#include "support/forkedcontr.h"
+#include "support/lstrings.h"
+#include "support/lyxlib.h"
+#include "support/filetools.h"
+#include "support/os.h"
+
 #include "debug.h"
+
 #include "frontends/Timeout.h"
 
 #include <boost/bind.hpp>
@@ -270,6 +272,29 @@ int Forkedcall::generateChild()
                        argv.push_back(&*vit);
                prev = *vit;
        }
+       // Strip quotes. Does so naively, assuming that the word begins
+       // and ends in quotes.
+       vector<char *>::iterator ait = argv.begin();
+       vector<char *>::iterator const aend = argv.end();
+       for (; ait != aend; ++ait) {
+               char * word = *ait;
+               std::size_t const len = strlen(word);
+               if (len >= 2) {
+                       char & first = word[0];
+                       char & last = word[len-1];
+
+                       if (first == last &&
+                           (first == '\'' || first == '"')) {
+                               first = '\0';
+                               last = '\0';
+                               *ait += 1;
+                       }
+               }
+       }
+
+       ait = argv.begin();
+       for (; ait != aend; ++ait)
+               std::cout << *ait << std::endl;
        argv.push_back(0);
 
 #ifndef __EMX__