Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
810 B

  1. /*
  2. *
  3. * miscdbg.c
  4. *
  5. * Miscellaneous helper routines.
  6. *
  7. */
  8. #include "actdbg.hxx"
  9. BOOL
  10. ParseArgString(
  11. IN char * pszArgString,
  12. OUT DWORD * pArgc,
  13. OUT char * Argv[MAXARGS]
  14. )
  15. {
  16. char * pszArg;
  17. *pArgc = 0;
  18. memset( Argv, 0, sizeof(Argv) );
  19. if ( ! pszArgString )
  20. return TRUE;
  21. pszArg = pszArgString;
  22. for (;;)
  23. {
  24. while ( *pszArg == ' ' || *pszArg == '\t' )
  25. pszArg++;
  26. if ( *pszArg )
  27. {
  28. if ( MAXARGS == *pArgc )
  29. return FALSE;
  30. Argv[*pArgc] = pszArg;
  31. (*pArgc)++;
  32. }
  33. while ( *pszArg && *pszArg != L' ' && *pszArg != L'\t' )
  34. pszArg++;
  35. if ( ! *pszArg )
  36. break;
  37. *pszArg++ = 0;
  38. }
  39. return TRUE;
  40. }