Changeset 56002 in vbox for trunk/src/VBox/Runtime/common/misc
- Timestamp:
- May 21, 2015 12:19:28 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 100513
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/getoptargv.cpp
r55673 r56002 334 334 break; 335 335 if (Cp == '"') 336 fInQuote = !fInQuote; 336 { 337 /* Two double quotes insides a quoted string in an escape 338 sequence and we output one double quote char. 339 See http://www.daviddeley.com/autohotkey/parameters/parameters.htm */ 340 if (!fInQuote) 341 fInQuote = true; 342 else if (*pszSrc != '"') 343 fInQuote = false; 344 else 345 { 346 pszDst = RTStrPutCp(pszDst, '"'); 347 pszSrc++; 348 } 349 } 337 350 else if (!fInQuote && rtGetOptIsCpInSet(Cp, pszSeparators, cchSeparators)) 338 351 break; … … 343 356 /* A backslash sequence is only relevant if followed by 344 357 a double quote, then it will work like an escape char. */ 345 size_t c Quotes = 1;358 size_t cSlashes = 1; 346 359 while (*pszSrc == '\\') 347 360 { 348 c Quotes++;361 cSlashes++; 349 362 pszSrc++; 350 363 } 351 364 if (*pszSrc != '"') 352 365 /* Not an escape sequence. */ 353 while (c Quotes-- > 0)366 while (cSlashes-- > 0) 354 367 pszDst = RTStrPutCp(pszDst, '\\'); 355 368 else … … 357 370 /* Escape sequence. Output half of the slashes. If odd 358 371 number, output the escaped double quote . */ 359 while (c Quotes >= 2)372 while (cSlashes >= 2) 360 373 { 361 374 pszDst = RTStrPutCp(pszDst, '\\'); 362 c Quotes -= 2;375 cSlashes -= 2; 363 376 } 364 if (!cQuotes) 365 fInQuote = !fInQuote; 366 else 377 if (cSlashes) 378 { 367 379 pszDst = RTStrPutCp(pszDst, '"'); 368 pszSrc++; 380 pszSrc++; 381 } 369 382 } 370 383 }
Note:
See TracChangeset
for help on using the changeset viewer.