diff options
author | Matthieu Herrb <matthieu.herrb@laas.fr> | 2011-06-05 11:26:31 +0200 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2011-06-05 11:26:31 +0200 |
commit | b2365de9199c4779cceba2505bc8463e1740bb62 (patch) | |
tree | 5dcb8de470a1efdc71ce659723cf3e9b24d72d50 /src/util.c | |
parent | c066d43835faafd79531ee40a2fa575e596bed2f (diff) | |
parent | 70a7f34dfc4d7ea4f7425b9a7359a08a35752bb0 (diff) |
Merge remote-tracking branch 'origin/master' into obsd
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 66 |
1 files changed, 0 insertions, 66 deletions
@@ -767,72 +767,6 @@ SetFocus (TwmWindow *tmp_win, Time time) XSetInputFocus (dpy, w, RevertToPointerRoot, time); } - -#ifdef NOPUTENV -/** - * define our own putenv() if the system doesn't have one. - * putenv(s): place s (a string of the form "NAME=value") in - * the environment; replacing any existing NAME. s is placed in - * environment, so if you change s, the environment changes (like - * putenv on a sun). Binding removed if you putenv something else - * called NAME. - */ -int -putenv(char *s) -{ - char *v; - int varlen, idx; - extern char **environ; - char **newenv; - static int virgin = 1; /* true while "environ" is a virgin */ - - v = index(s, '='); - if(v == 0) - return 0; /* punt if it's not of the right form */ - varlen = (v + 1) - s; - - for (idx = 0; environ[idx] != 0; idx++) { - if (strncmp(environ[idx], s, varlen) == 0) { - if(v[1] != 0) { /* true if there's a value */ - environ[idx] = s; - return 0; - } else { - do { - environ[idx] = environ[idx+1]; - } while(environ[++idx] != 0); - return 0; - } - } - } - - /* add to environment (unless no value; then just return) */ - if(v[1] == 0) - return 0; - if(virgin) { - register i; - - newenv = (char **) malloc((unsigned) ((idx + 2) * sizeof(char*))); - if(newenv == 0) - return -1; - for(i = idx-1; i >= 0; --i) - newenv[i] = environ[i]; - virgin = 0; /* you're not a virgin anymore, sweety */ - } else { - newenv = (char **) realloc((char *) environ, - (unsigned) ((idx + 2) * sizeof(char*))); - if (newenv == 0) - return -1; - } - - environ = newenv; - environ[idx] = s; - environ[idx+1] = 0; - - return 0; -} -#endif /* NOPUTENV */ - - static Pixmap CreateXLogoPixmap (unsigned *widthp, unsigned *heightp) { |