]> git.lyx.org Git - lyx.git/blobdiff - src/support/forkedcall.C
* lyxfunctional.h: delete compare_memfun and helper classes
[lyx.git] / src / support / forkedcall.C
index 188019d2d285a22c64f15b41d28b4dc458f281e6..7fa823cf4c3261c966fa86b76ba32e4a102651a5 100644 (file)
@@ -270,6 +270,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__