From: <laz...@us...> - 2004-02-29 21:11:46
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22997/src/core Modified Files: rchar.cpp Log Message: More string fixes - Own strtok_r - removed strrev (who will need that?) :) Index: rchar.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/rchar.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rchar.cpp 29 Feb 2004 17:57:10 -0000 1.7 --- rchar.cpp 29 Feb 2004 20:53:25 -0000 1.8 *************** *** 34,37 **** --- 34,67 ---- } + RCHAR *rstrtok_r (RCHAR *s, const RCHAR *delim, RCHAR **save_ptr) + { + RCHAR *token; + + if (s == NULL) + s = *save_ptr; + + /* Scan leading delimiters. */ + s += rstrspn (s, delim); + if (*s == '\0') + { + *save_ptr = s; + return NULL; + } + + /* Find the end of the token. */ + token = s; + s = rstrpbrk (token, delim); + if (s == NULL) { + /* This token finishes the string. */ + *save_ptr = rstrchr(token, '\0'); + } else + { + /* Terminate the token and make *SAVE_PTR point past it. */ + *s = '\0'; + *save_ptr = s + 1; + } + return token; + } + #if !defined(_RTK_WIN32_) && defined(UNICODE) |