diff options
author | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-09-14 03:30:39 +0000 |
---|---|---|
committer | special <special@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-09-14 03:30:39 +0000 |
commit | 1b290edc9cfba6ed94e04257035c37c4df5e5c2d (patch) | |
tree | 2388db786780771d809328fb046b658e48fc7b71 /win/inspircd_win32wrapper.cpp | |
parent | b70a2f3e35957bc4951260618710ae452c0f8f6b (diff) |
Patch by dz to remove the one usage of strdup/strtok_r, which is very un-C++ behavior (and silly, since we have sepstream)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10543 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'win/inspircd_win32wrapper.cpp')
-rw-r--r-- | win/inspircd_win32wrapper.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index 0b738d538..03d89a7aa 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -91,71 +91,6 @@ int inet_pton(int af, const char *src, void *dst) return rv; } -char * strtok_r(char *_String, const char *_Control, char **_Context) -{ - unsigned char *str; - const unsigned char *ctl = (const unsigned char*)_Control; - unsigned char map[32]; - - if (_Context == 0 || !_Control) - return 0; - - if (!(_String != NULL || *_Context != NULL)) - return 0; - - memset(map, 0, 32); - - do { - map[*ctl >> 3] |= (1 << (*ctl & 7)); - } while (*ctl++); - - /* If string is NULL, set str to the saved - * pointer (i.e., continue breaking tokens out of the string - * from the last strtok call) */ - if (_String != NULL) - { - str = (unsigned char*)_String; - } - else - { - str = (unsigned char*)*_Context; - } - - /* Find beginning of token (skip over leading delimiters). Note that - * there is no token iff this loop sets str to point to the terminal - * null (*str == 0) */ - while ((map[*str >> 3] & (1 << (*str & 7))) && *str != 0) - { - str++; - } - - _String = (char*)str; - - /* Find the end of the token. If it is not the end of the string, - * put a null there. */ - for ( ; *str != 0 ; str++ ) - { - if (map[*str >> 3] & (1 << (*str & 7))) - { - *str++ = 0; - break; - } - } - - /* Update context */ - *_Context = (char*)str; - - /* Determine if a token has been found. */ - if (_String == (char*)str) - { - return NULL; - } - else - { - return _String; - } -} - void setcolor(int color_code) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color_code); |