diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-10-17 12:20:57 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-10-17 12:20:57 +0000 |
commit | bdfbf7b573eb9241213fc56041b46e3054031619 (patch) | |
tree | e835b03315cb791b61a1cbcc2c467cb2696ab7e2 /idlc/source/options.cxx | |
parent | b8245aaa3b46c5baf4b5de55240c68869f13309e (diff) |
INTEGRATION: CWS jscpp1 (1.10.24); FILE MERGED
2005/08/09 11:47:09 jsc 1.10.24.1: #i52596# improve reading command line option
Diffstat (limited to 'idlc/source/options.cxx')
-rw-r--r-- | idlc/source/options.cxx | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx index 997e2ac44770..dd856547bbe9 100644 --- a/idlc/source/options.cxx +++ b/idlc/source/options.cxx @@ -4,9 +4,9 @@ * * $RCSfile: options.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: rt $ $Date: 2005-09-07 18:12:45 $ + * last change: $Author: rt $ $Date: 2005-10-17 13:20:57 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -244,8 +244,31 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile) char* rargv[512]; char buffer[512]; - while ( fscanf(cmdFile, "%s", buffer) != EOF ) + int i=0; + int found = 0; + char c; + while ( fscanf(cmdFile, "%c", &c) != EOF ) { + if (c=='\"') { + if (found) { + found=0; + } else { + found=1; + continue; + } + } else { + if (c!=13 && c!=10) { + if (found || c!=' ') { + buffer[i++]=c; + continue; + } + } + if (i==0) + continue; + } + buffer[i]='\0'; + found=0; + i=0; rargv[rargc]= strdup(buffer); rargc++; } |