Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: third_party/minicrt/argcargv.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/minicrt/argcargv.h ('k') | third_party/minicrt/bsearch.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/minicrt/argcargv.cc
diff --git a/third_party/minicrt/argcargv.cc b/third_party/minicrt/argcargv.cc
deleted file mode 100644
index 851f8cb632ac60cdf4359992a9f8e4670f36d5d8..0000000000000000000000000000000000000000
--- a/third_party/minicrt/argcargv.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-//==========================================
-// LIBCTINY - Matt Pietrek 2001
-// MSDN Magazine, January 2001
-//==========================================
-#include "libctiny.h"
-#include <windows.h>
-#include "argcargv.h"
-
-#define _MAX_CMD_LINE_ARGS 128
-
-char * _ppszArgv[_MAX_CMD_LINE_ARGS+1];
-
-int __cdecl _ConvertCommandLineToArgcArgv() {
- int cbCmdLine;
- int argc;
- PSTR pszSysCmdLine, pszCmdLine;
-
- // Set to no argv elements, in case we have to bail out
- _ppszArgv[0] = 0;
-
- // First get a pointer to the system's version of the command line, and
- // figure out how long it is.
- pszSysCmdLine = GetCommandLine();
- cbCmdLine = lstrlen( pszSysCmdLine );
-
- // Allocate memory to store a copy of the command line. We'll modify
- // this copy, rather than the original command line. Yes, this memory
- // currently doesn't explicitly get freed, but it goes away when the
- // process terminates.
- pszCmdLine = (PSTR)HeapAlloc( GetProcessHeap(), 0, cbCmdLine+1 );
- if (!pszCmdLine)
- return 0;
-
- // Copy the system version of the command line into our copy
- lstrcpyn( pszCmdLine, pszSysCmdLine , cbCmdLine+1);
-
- if ('"' == *pszCmdLine) // If command line starts with a quote ("),
- { // it's a quoted filename. Skip to next quote.
- pszCmdLine++;
-
- _ppszArgv[0] = pszCmdLine; // argv[0] == executable name
-
- while (*pszCmdLine && (*pszCmdLine != '"'))
- pszCmdLine++;
-
- if (*pszCmdLine) // Did we see a non-NULL ending?
- *pszCmdLine++ = 0; // Null terminate and advance to next char
- else
- return 0; // Oops! We didn't see the end quote
- }
- else // A regular (non-quoted) filename
- {
- _ppszArgv[0] = pszCmdLine; // argv[0] == executable name
-
- while (*pszCmdLine && (' ' != *pszCmdLine) && ('\t' != *pszCmdLine))
- pszCmdLine++;
-
- if (*pszCmdLine)
- *pszCmdLine++ = 0; // Null terminate and advance to next char
- }
-
- // Done processing argv[0] (i.e., the executable name). Now do th
- // actual arguments
-
- argc = 1;
-
- while (1)
- {
- // Skip over any whitespace
- while (*pszCmdLine && (' ' == *pszCmdLine) || ('\t' == *pszCmdLine))
- pszCmdLine++;
-
- if (0 == *pszCmdLine) // End of command line???
- return argc;
-
- if ('"' == *pszCmdLine) // Argument starting with a quote???
- {
- pszCmdLine++; // Advance past quote character
-
- _ppszArgv[ argc++ ] = pszCmdLine;
- _ppszArgv[ argc ] = 0;
-
- // Scan to end quote, or NULL terminator
- while (*pszCmdLine && (*pszCmdLine != '"'))
- pszCmdLine++;
-
- if (0 == *pszCmdLine)
- return argc;
-
- if (*pszCmdLine)
- *pszCmdLine++ = 0; // Null terminate and advance to next char
- }
- else // Non-quoted argument
- {
- _ppszArgv[ argc++ ] = pszCmdLine;
- _ppszArgv[ argc ] = 0;
-
- // Skip till whitespace or NULL terminator
- while (*pszCmdLine && (' '!=*pszCmdLine) && ('\t'!=*pszCmdLine))
- pszCmdLine++;
-
- if (0 == *pszCmdLine)
- return argc;
-
- if (*pszCmdLine)
- *pszCmdLine++ = 0; // Null terminate and advance to next char
- }
-
- if (argc >= (_MAX_CMD_LINE_ARGS))
- return argc;
- }
-}
« no previous file with comments | « third_party/minicrt/argcargv.h ('k') | third_party/minicrt/bsearch.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698