summaryrefslogtreecommitdiffstats
path: root/src/config.l
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-04-17 18:47:53 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2000-04-17 18:47:53 (GMT)
commit0e7fba152ca1c24593a5c9b01460116d16ca3f97 (patch)
tree25b1690e57effb00b6b482041be7b48ca0ae643e /src/config.l
parent0001e1e28b80b870b85b82b9f1cacfdb5cd834eb (diff)
downloadDoxygen-0e7fba152ca1c24593a5c9b01460116d16ca3f97.zip
Doxygen-0e7fba152ca1c24593a5c9b01460116d16ca3f97.tar.gz
Doxygen-0e7fba152ca1c24593a5c9b01460116d16ca3f97.tar.bz2
Release-1.1.2-20000417
Diffstat (limited to 'src/config.l')
-rw-r--r--src/config.l58
1 files changed, 53 insertions, 5 deletions
diff --git a/src/config.l b/src/config.l
index 01cb527..faaebda 100644
--- a/src/config.l
+++ b/src/config.l
@@ -1650,11 +1650,59 @@ static void substEnvVarsInStrList(QStrList &sl)
{
QCString result(s);
substEnvVarsInString(result);
-
- // replace the string in the list and go to the next item.
- sl.insert(sl.at(),result); // insert new item before current item.
- sl.next(); // current item is now the old item
- int i=sl.at();
+
+ int l=result.length();
+ int i,p=0;
+ // skip spaces
+ // search for a "word"
+ for (i=0;i<l;i++)
+ {
+ char c;
+ // skip until start of new word
+ for (;i<l && ((c=result.at(i))==' ' || c=='\t');i++)
+ p=i; // p marks the start index of the word
+ // skip until end of a word
+ for (;i<l && ((c=result.at(i))!=' ' && c!='\t' && c!='"');i++);
+ if (i<l) // not at the end of the string
+ {
+ if (c=='"') // word within quotes
+ {
+ p=i+1;
+ for (i++;i<l;i++)
+ {
+ c=result.at(i);
+ if (c=='"') // end quote
+ {
+ // replace the string in the list and go to the next item.
+ sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item.
+ sl.next(); // current item is now the old item
+ p=i+1;
+ break;
+ }
+ else if (c=='\\') // skip escaped stuff
+ {
+ i++;
+ }
+ }
+ }
+ else if (c==' ' || c=='\t') // separator
+ {
+ // replace the string in the list and go to the next item.
+ sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item.
+ sl.next(); // current item is now the old item
+ p=i+1;
+ }
+ }
+ }
+ if (p!=l) // add the leftover as a string
+ {
+ // replace the string in the list and go to the next item.
+ sl.insert(sl.at(),result.right(l-p)); // insert new item before current item.
+ sl.next(); // current item is now the old item
+ }
+
+ // remove the old unexpanded string from the list
+ i=sl.at();
sl.remove(); // current item index changes if the last element is removed.
if (sl.at()==i) // not last item
s = sl.current();