summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-26 22:32:13 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-26 22:32:13 +0200
commit7c5a21dd4142c414de4e5925533e8cfbb6f329b0 (patch)
treece244ac539f30a4334c7bb5897b0cde0872796c8 /rsc
parentaa6495b6fa231abfe8b55a806ff6d5a306843cd3 (diff)
rsc: ignore -isystem args
Change-Id: Ic46b84d740159826542ead857d15230d54547d88
Diffstat (limited to 'rsc')
-rw-r--r--rsc/source/prj/start.cxx15
-rw-r--r--rsc/source/rsc/rsc.cxx15
-rw-r--r--rsc/source/rscpp/cpp3.c14
3 files changed, 41 insertions, 3 deletions
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
index 46c62a7a1f2f..7c7cc3288dea 100644
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -235,7 +235,20 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
bool bSetSrs = false;
while( ppStr && i < (aCmdLine.GetCount() -1) )
{
- if( '-' == **ppStr )
+ if (strcmp(*ppStr, "-isystem") == 0)
+ {
+ // ignore "-isystem" and following arg
+ if (i < aCmdLine.GetCount() - 1)
+ {
+ ++ppStr;
+ ++i;
+ }
+ }
+ else if (strncmp(*ppStr, "-isystem", strlen("-isystem")) == 0)
+ {
+ // ignore args starting with "-isystem"
+ }
+ else if( '-' == **ppStr )
{
if( !rsc_stricmp( (*ppStr) + 1, "p" )
|| !rsc_stricmp( (*ppStr) + 1, "l" ) )
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 0fac4102cb09..e5a7228fa335 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -100,7 +100,20 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "CmdLineArg: \"%s\"\n", *ppStr );
#endif
- if( '-' == **ppStr )
+ if (strcmp(*ppStr, "-isystem") == 0)
+ {
+ // ignore "-isystem" and following arg
+ if (i < aCmdLine.GetCount() - 1)
+ {
+ ++ppStr;
+ ++i;
+ }
+ }
+ else if (strncmp(*ppStr, "-isystem", strlen("-isystem")) == 0)
+ {
+ // ignore args starting with "-isystem"
+ }
+ else if( '-' == **ppStr )
{
if( !rsc_stricmp( (*ppStr) + 1, "h" )
|| !strcmp( (*ppStr) + 1, "?" ) )
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c
index 287b2a583d88..023616495d9c 100644
--- a/rsc/source/rscpp/cpp3.c
+++ b/rsc/source/rscpp/cpp3.c
@@ -217,7 +217,19 @@ dooptions(int argc, char** argv)
for (i = j = 1; i < argc; i++) {
arg = ap = argv[i];
- if (*ap++ != '-' || *ap == EOS)
+ if (strcmp(arg, "-isystem") == 0)
+ {
+ // ignore "-isystem" and following arg
+ if (i < argc)
+ {
+ ++i;
+ }
+ }
+ else if (strncmp(arg, "-isystem", strlen("-isystem")) == 0)
+ {
+ // ignore args starting with "-isystem"
+ }
+ else if (*ap++ != '-' || *ap == EOS)
{
argv[j++] = argv[i];
}