diff options
author | marha <marha@users.sourceforge.net> | 2010-02-14 21:52:51 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-02-14 21:52:51 +0000 |
commit | 00e6751183c1e854ea3eba746b101449b32201a4 (patch) | |
tree | 3494085d6728e086582f30c8a68846d81840303d /xorg-server/os/utils.c | |
parent | ac637a8cd15f3977f44b701c7ac71a561763c1d8 (diff) | |
parent | 8d38172d866775594af3185ae3fbd8d750677650 (diff) | |
download | vcxsrv-00e6751183c1e854ea3eba746b101449b32201a4.tar.gz vcxsrv-00e6751183c1e854ea3eba746b101449b32201a4.tar.bz2 vcxsrv-00e6751183c1e854ea3eba746b101449b32201a4.zip |
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/os/utils.c')
-rw-r--r-- | xorg-server/os/utils.c | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index a3fc1acf8..b5015b2c9 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -517,9 +517,7 @@ void UseMsg(void) #ifdef RLIMIT_STACK ErrorF("-ls int limit stack space to N Kb\n"); #endif -#ifdef SERVER_LOCK ErrorF("-nolock disable the locking mechanism\n"); -#endif #ifndef NOLOGOHACK ErrorF("-logo enable logo in screen saver\n"); ErrorF("nologo disable logo in screen saver\n"); @@ -771,7 +769,6 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); } #endif -#ifdef SERVER_LOCK else if ( strcmp ( argv[i], "-nolock") == 0) { #if !defined(WIN32) && !defined(__CYGWIN__) @@ -781,7 +778,6 @@ ProcessCommandLine(int argc, char *argv[]) #endif nolock = TRUE; } -#endif #ifndef NOLOGOHACK else if ( strcmp( argv[i], "-logo") == 0) { @@ -1885,6 +1881,46 @@ CheckUserAuthorization(void) #endif } +/* + * Tokenize a string into a NULL terminated array of strings. Always returns + * an allocated array unless an error occurs. + */ +char** +xstrtokenize(const char *str, const char *separators) +{ + char **list, **nlist; + char *tok, *tmp; + unsigned num = 0, n; + + if (!str) + return NULL; + list = calloc(1, sizeof(*list)); + if (!list) + return NULL; + tmp = strdup(str); + if (!tmp) + goto error; + for (tok = strtok(tmp, separators); tok; tok = strtok(NULL, separators)) { + nlist = realloc(list, (num + 2) * sizeof(*list)); + if (!nlist) + goto error; + list = nlist; + list[num] = strdup(tok); + if (!list[num]) + goto error; + list[++num] = NULL; + } + free(tmp); + return list; + +error: + free(tmp); + for (n = 0; n < num; n++) + free(list[n]); + free(list); + return NULL; +} + #ifdef __SCO__ #include <fcntl.h> |