MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / ExtractFirstArgument

Function ExtractFirstArgument

src/Helpers.c:1224–1256  ·  view source on GitHub ↗

============================================================================= ExtractFirstArgument()

Source from the content-addressed store, hash-verified

1222// ExtractFirstArgument()
1223//
1224BOOL ExtractFirstArgument ( LPCWSTR lpArgs, LPWSTR lpArg1, LPWSTR lpArg2 )
1225{
1226 LPWSTR psz;
1227 BOOL bQuoted = FALSE;
1228 lstrcpy ( lpArg1, lpArgs );
1229 if ( lpArg2 ) {
1230 *lpArg2 = L'\0';
1231 }
1232 if ( !TrimString ( lpArg1 ) ) {
1233 return FALSE;
1234 }
1235 if ( *lpArg1 == L'\"' ) {
1236 *lpArg1 = L' ';
1237 TrimString ( lpArg1 );
1238 bQuoted = TRUE;
1239 }
1240 if ( bQuoted ) {
1241 psz = StrChr ( lpArg1, L'\"' );
1242 } else {
1243 psz = StrChr ( lpArg1, L' ' );
1244 };
1245 if ( psz ) {
1246 *psz = L'\0';
1247 if ( lpArg2 ) {
1248 lstrcpy ( lpArg2, psz + 1 );
1249 }
1250 }
1251 TrimString ( lpArg1 );
1252 if ( lpArg2 ) {
1253 TrimString ( lpArg2 );
1254 }
1255 return TRUE;
1256}
1257
1258
1259//=============================================================================

Callers 4

RunDlgProcFunction · 0.85
MsgCommandFunction · 0.85
ParseCommandLineFunction · 0.85
RelaunchElevatedFunction · 0.85

Calls 1

TrimStringFunction · 0.85

Tested by

no test coverage detected