Changeset 13551 in vbox for trunk/src/VBox/Main/ConsoleImpl.cpp
- Timestamp:
- Oct 24, 2008 12:10:08 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 38416
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r13417 r13551 3659 3659 VBOXHGCMSVCPARM parm[3]; 3660 3660 3661 /* 3662 * Set up the pattern parameter, translating the comma-separated list to a 3663 * double-terminated zero-separated one. 3664 */ 3665 Utf8Str utf8In(aPatterns); 3666 Utf8Str utf8Out(utf8In.length() + 2); /* Double terminator */ 3667 if ( ((aPatterns != NULL) && (utf8In.isNull())) 3668 || utf8Out.isNull()) 3669 return E_OUTOFMEMORY; 3670 const char *pcszIn = utf8In.raw(); 3671 char *pszzOut = utf8Out.mutableRaw(); 3672 size_t iIn = 0, iOut = 0; 3673 if (aPatterns != NULL) 3674 while (pcszIn[iIn] != '\0') 3675 { 3676 if (pcszIn[iIn] != ',') 3677 { 3678 pszzOut[iOut] = pcszIn[iIn]; 3679 ++iIn; 3680 } 3681 else 3682 { 3683 pszzOut[iOut] = '\0'; 3684 while ((',' == pcszIn[iIn]) || (' ' == pcszIn[iIn])) 3685 ++iIn; 3686 } 3687 ++iOut; 3688 } 3689 pszzOut[iOut] = '\0'; 3690 3661 Utf8Str utf8Patterns(aPatterns); 3691 3662 parm[0].type = VBOX_HGCM_SVC_PARM_PTR; 3692 parm[0].u.pointer.addr = pszzOut;3693 parm[0].u.pointer.size = iOut+ 1;3663 parm[0].u.pointer.addr = utf8Patterns.mutableRaw(); 3664 parm[0].u.pointer.size = utf8Patterns.length() + 1; 3694 3665 3695 3666 /*
Note:
See TracChangeset
for help on using the changeset viewer.