Changeset 13444 in vbox
- Timestamp:
- Oct 21, 2008 1:43:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r13436 r13444 2840 2840 static bool matchesSinglePatternEx(const char *pszPat, size_t cchPat, const char *pszName) 2841 2841 { 2842 size_t iPat = 0;2843 2842 /* ASSUMES ASCII */ 2844 2843 for (;;) 2845 2844 { 2846 char chPat = pszPat[iPat];2845 char chPat = *pszPat; 2847 2846 switch (chPat) 2848 2847 { … … 2854 2853 case '*': 2855 2854 { 2856 while ( ( (chPat = pszPat[++iPat]) == '*' || chPat == '?')2857 && ( iPat < cchPat)2855 while ( (--cchPat > 0) 2856 && ((chPat = *++pszPat) == '*' || chPat == '?') 2858 2857 ) 2859 2858 /* nothing */; … … 2864 2863 if ( ch == chPat 2865 2864 && ( !chPat 2866 || matchesSinglePatternEx(pszPat + iPat +1,2867 cchPat - iPat -1, pszName)2865 || matchesSinglePatternEx(pszPat + 1, 2866 cchPat - 1, pszName) 2868 2867 ) 2869 2868 ) … … 2886 2885 pszName++; 2887 2886 pszPat++; 2888 if ( iPat == cchPat)2887 if (--cchPat == 0) 2889 2888 return !*pszName; 2889 Assert(cchPat > 0); 2890 2890 } 2891 2891 return true; … … 2905 2905 size_t iOffs = 0; 2906 2906 /* If the first pattern in the list is empty, treat it as "match all". */ 2907 bool matched = (cchPatterns > 0) && (0 == *paszPatterns) ? true : false;2907 bool matched = (cchPatterns > 0) && (0 == *paszPatterns); 2908 2908 while ((iOffs < cchPatterns) && !matched) 2909 2909 { … … 2931 2931 const char *pcszCur = pcszPatterns; 2932 2932 /* If list is empty, treat it as "match all". */ 2933 bool matched = (0 == *pcszPatterns) ? true : false;2933 bool matched = (0 == *pcszPatterns); 2934 2934 bool done = false; 2935 2935 while (!done && !matched)
Note:
See TracChangeset
for help on using the changeset viewer.