Changeset 55529 in vbox
- Timestamp:
- Apr 29, 2015 5:38:33 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/iprt/getopt.h (modified) (1 diff)
-
src/VBox/Runtime/common/misc/getoptargv.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/getopt.h
r48934 r55529 438 438 /** Quote strings according to the Unix Bourne Shell. */ 439 439 #define RTGETOPTARGV_CNV_QUOTE_BOURNE_SH UINT32_C(1) 440 /** Don't quote any strings at all. */ 441 #define RTGETOPTARGV_CNV_UNQUOTED UINT32_C(2) 440 442 /** Mask for the quoting style. */ 441 #define RTGETOPTARGV_CNV_QUOTE_MASK UINT32_C( 1)443 #define RTGETOPTARGV_CNV_QUOTE_MASK UINT32_C(3) 442 444 /** @} */ 443 445 -
trunk/src/VBox/Runtime/common/misc/getoptargv.cpp
r55494 r55529 368 368 DECLINLINE(bool) rtGetOpArgvRequiresQuoting(const char *pszArg, uint32_t fFlags, size_t *pcch) 369 369 { 370 char const *psz = pszArg; 371 unsigned char ch; 372 while ((ch = (unsigned char)*psz)) 373 { 374 if ( ch < 128 375 && ASMBitTest(&g_abmQuoteChars[fFlags & RTGETOPTARGV_CNV_QUOTE_MASK], ch)) 376 return true; 377 psz++; 378 } 379 380 *pcch = psz - pszArg; 370 if ((fFlags & RTGETOPTARGV_CNV_QUOTE_MASK) != RTGETOPTARGV_CNV_UNQUOTED) 371 { 372 char const *psz = pszArg; 373 unsigned char ch; 374 while ((ch = (unsigned char)*psz)) 375 { 376 if ( ch < 128 377 && ASMBitTest(&g_abmQuoteChars[fFlags & RTGETOPTARGV_CNV_QUOTE_MASK], ch)) 378 return true; 379 psz++; 380 } 381 382 *pcch = psz - pszArg; 383 } 384 else 385 *pcch = strlen(pszArg); 381 386 return false; 382 387 } … … 417 422 RTDECL(int) RTGetOptArgvToString(char **ppszCmdLine, const char * const *papszArgv, uint32_t fFlags) 418 423 { 419 AssertReturn( !(fFlags & ~RTGETOPTARGV_CNV_QUOTE_MASK), VERR_INVALID_PARAMETER);424 AssertReturn(fFlags <= RTGETOPTARGV_CNV_UNQUOTED, VERR_INVALID_PARAMETER); 420 425 421 426 #define PUT_CH(ch) \
Note:
See TracChangeset
for help on using the changeset viewer.

