Kaydet (Commit) 72c8db49 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Consistently accept all cmd line args only in lower case

Change-Id: Ie57814f1e938ee9d909d69a518bed29026cb4963
üst 5993dc79
...@@ -263,7 +263,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -263,7 +263,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
{ {
m_version = true; m_version = true;
} }
else if ( oArg.startsWithIgnoreAsciiCase("splash-pipe=") ) else if ( oArg.startsWith("splash-pipe=") )
{ {
m_splashpipe = true; m_splashpipe = true;
} }
...@@ -294,23 +294,23 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -294,23 +294,23 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bDeprecated = false; bDeprecated = false;
} }
#endif #endif
else if ( oArg.startsWithIgnoreAsciiCase("infilter=")) else if ( oArg.startsWith("infilter="))
{ {
m_infilter.push_back(oArg.copy(RTL_CONSTASCII_LENGTH("infilter="))); m_infilter.push_back(oArg.copy(RTL_CONSTASCII_LENGTH("infilter=")));
} }
else if ( oArg.startsWithIgnoreAsciiCase("accept=")) else if ( oArg.startsWith("accept="))
{ {
m_accept.push_back(oArg.copy(RTL_CONSTASCII_LENGTH("accept="))); m_accept.push_back(oArg.copy(RTL_CONSTASCII_LENGTH("accept=")));
} }
else if ( oArg.startsWithIgnoreAsciiCase("unaccept=")) else if ( oArg.startsWith("unaccept="))
{ {
m_unaccept.push_back(oArg.copy(RTL_CONSTASCII_LENGTH("unaccept="))); m_unaccept.push_back(oArg.copy(RTL_CONSTASCII_LENGTH("unaccept=")));
} }
else if ( oArg.startsWithIgnoreAsciiCase("language=")) else if ( oArg.startsWith("language="))
{ {
m_language = oArg.copy(RTL_CONSTASCII_LENGTH("language=")); m_language = oArg.copy(RTL_CONSTASCII_LENGTH("language="));
} }
else if ( oArg.startsWithIgnoreAsciiCase("pidfile=")) else if ( oArg.startsWith("pidfile="))
{ {
m_pidfile = oArg.copy(RTL_CONSTASCII_LENGTH("pidfile=")); m_pidfile = oArg.copy(RTL_CONSTASCII_LENGTH("pidfile="));
} }
...@@ -354,7 +354,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -354,7 +354,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
m_web = true; m_web = true;
m_bDocumentArgs = true; m_bDocumentArgs = true;
} }
else if ( aArg.equalsIgnoreAsciiCase("-n")) else if ( aArg == "-n" )
{ {
// force new documents based on the following documents // force new documents based on the following documents
bForceNewEvent = true; bForceNewEvent = true;
...@@ -366,7 +366,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -366,7 +366,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false; bStartEvent = false;
bDisplaySpec = false; bDisplaySpec = false;
} }
else if ( aArg.equalsIgnoreAsciiCase("-o")) else if ( aArg == "-o" )
{ {
// force open documents regardless if they are templates or not // force open documents regardless if they are templates or not
bForceOpenEvent = true; bForceOpenEvent = true;
...@@ -378,7 +378,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -378,7 +378,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false; bStartEvent = false;
bDisplaySpec = false; bDisplaySpec = false;
} }
else if ( oArg.equalsIgnoreAsciiCase("pt")) else if ( oArg == "pt" )
{ {
// Print to special printer // Print to special printer
bPrintToEvent = true; bPrintToEvent = true;
...@@ -391,7 +391,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -391,7 +391,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bDisplaySpec = false; bDisplaySpec = false;
bForceOpenEvent = false; bForceOpenEvent = false;
} }
else if ( aArg.equalsIgnoreAsciiCase("-p")) else if ( aArg == "-p" )
{ {
// Print to default printer // Print to default printer
bPrintEvent = true; bPrintEvent = true;
...@@ -403,7 +403,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -403,7 +403,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false; bStartEvent = false;
bDisplaySpec = false; bDisplaySpec = false;
} }
else if ( oArg.equalsIgnoreAsciiCase("view")) else if ( oArg == "view")
{ {
// open in viewmode // open in viewmode
bOpenEvent = false; bOpenEvent = false;
...@@ -415,7 +415,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -415,7 +415,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false; bStartEvent = false;
bDisplaySpec = false; bDisplaySpec = false;
} }
else if ( oArg.equalsIgnoreAsciiCase("show")) else if ( oArg == "show" )
{ {
// open in viewmode // open in viewmode
bOpenEvent = false; bOpenEvent = false;
...@@ -427,7 +427,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -427,7 +427,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bForceOpenEvent = false; bForceOpenEvent = false;
bDisplaySpec = false; bDisplaySpec = false;
} }
else if ( oArg.equalsIgnoreAsciiCase("display")) else if ( oArg == "display" )
{ {
// set display // set display
bOpenEvent = false; bOpenEvent = false;
...@@ -439,7 +439,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -439,7 +439,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false; bStartEvent = false;
bDisplaySpec = true; bDisplaySpec = true;
} }
else if ( oArg.equalsIgnoreAsciiCase("language")) else if ( oArg == "language" )
{ {
bOpenEvent = false; bOpenEvent = false;
bPrintEvent = false; bPrintEvent = false;
...@@ -450,23 +450,22 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -450,23 +450,22 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
bStartEvent = false; bStartEvent = false;
bDisplaySpec = false; bDisplaySpec = false;
} }
else if ( oArg.equalsIgnoreAsciiCase("convert-to")) else if ( oArg == "convert-to" )
{ {
bOpenEvent = false; bOpenEvent = false;
bConversionEvent = true; bConversionEvent = true;
bConversionParamsEvent = true; bConversionParamsEvent = true;
} }
else if ( oArg.equalsIgnoreAsciiCase("print-to-file")) else if ( oArg == "print-to-file" )
{ {
bOpenEvent = false; bOpenEvent = false;
bBatchPrintEvent = true; bBatchPrintEvent = true;
} }
else if ( oArg.equalsIgnoreAsciiCase("printer-name") && else if ( oArg == "printer-name" && bBatchPrintEvent )
bBatchPrintEvent )
{ {
bBatchPrinterNameEvent = true; bBatchPrinterNameEvent = true;
} }
else if ( oArg.equalsIgnoreAsciiCase("outdir") && else if ( oArg == "outdir" &&
(bConversionEvent || bBatchPrintEvent) ) (bConversionEvent || bBatchPrintEvent) )
{ {
bConversionOutEvent = true; bConversionOutEvent = true;
...@@ -478,15 +477,15 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) ...@@ -478,15 +477,15 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
// primitive tools that /bin/sh offers, ignore them here // primitive tools that /bin/sh offers, ignore them here
if ( if (
#if defined UNX #if defined UNX
!oArg.equalsIgnoreAsciiCase("backtrace") && oArg != "backtrace" &&
!oArg.equalsIgnoreAsciiCase("strace") && oArg != "strace" &&
!oArg.equalsIgnoreAsciiCase("valgrind") && oArg != "valgrind" &&
// for X Session Management, handled in // for X Session Management, handled in
// vcl/unx/generic/app/sm.cxx: // vcl/unx/generic/app/sm.cxx:
!oArg.startsWith("session=") && oArg != "session=" &&
#endif #endif
//ignore additional legacy options that don't do anything anymore //ignore additional legacy options that don't do anything anymore
!oArg.equalsIgnoreAsciiCase("nocrashreport") && oArg != "nocrashreport" &&
m_unknown.isEmpty()) m_unknown.isEmpty())
{ {
m_unknown = aArg; m_unknown = aArg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment