diff -cNr emerald-0.7.8/themer/Makefile.in emerald-0.7.8_sol/themer/Makefile.in *** emerald-0.7.8/themer/Makefile.in 2008-09-19 01:26:36.000000000 +0900 --- emerald-0.7.8_sol/themer/Makefile.in 2009-01-21 15:14:31.197782281 +0900 *************** *** 45,51 **** am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) ! am_emerald_theme_manager_OBJECTS = main.$(OBJEXT) emerald_theme_manager_OBJECTS = $(am_emerald_theme_manager_OBJECTS) am__DEPENDENCIES_1 = emerald_theme_manager_DEPENDENCIES = $(am__DEPENDENCIES_1) \ --- 45,51 ---- am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) ! am_emerald_theme_manager_OBJECTS = main.$(OBJEXT) compat.$(OBJEXT) emerald_theme_manager_OBJECTS = $(am_emerald_theme_manager_OBJECTS) am__DEPENDENCIES_1 = emerald_theme_manager_DEPENDENCIES = $(am__DEPENDENCIES_1) \ *************** *** 226,232 **** target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ! emerald_theme_manager_SOURCES = main.c emerald_theme_manager_LDADD = $(EMERALD_LIBS) ../libengine/libemeraldengine.la INCLUDES = @EMERALD_CFLAGS@ \ -DPIXMAPS_DIR=\""$(datadir)/pixmaps"\"\ --- 226,232 ---- target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ! emerald_theme_manager_SOURCES = main.c compat.c emerald_theme_manager_LDADD = $(EMERALD_LIBS) ../libengine/libemeraldengine.la INCLUDES = @EMERALD_CFLAGS@ \ -DPIXMAPS_DIR=\""$(datadir)/pixmaps"\"\ diff -cNr emerald-0.7.8/themer/compat.c emerald-0.7.8_sol/themer/compat.c *** emerald-0.7.8/themer/compat.c 1970-01-01 09:00:00.000000000 +0900 --- emerald-0.7.8_sol/themer/compat.c 2009-01-21 15:09:03.957064835 +0900 *************** *** 0 **** --- 1,349 ---- + /* Copyright (c) 2007 Albert Lee . + * Copyright (c) 2006 Ulrich Spoerlein . + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + #include "config.h" + + #ifndef HAVE_STRVERSCMP + #include + #include + #include + + int strverscmp(const char *s1, const char *s2); + + int strverscmp(const char *s1, const char *s2) + { + static const char *digits = "0123456789"; + char *t1, *t2; + int ret; + long n1, n2; + size_t p1, p2; + + p1 = strcspn(s1, digits); + p2 = strcspn(s2, digits); + while (p1 == p2 && s1[p1] != '\0' && s2[p2] != '\0') { + /* Different prefix */ + if ((ret = strncmp(s1, s2, p1)) != 0) + return ret; + + s1 += p1; + s2 += p2; + n1 = strtol(s1, &t1, 10); + n2 = strtol(s2, &t2, 10); + + if (n1 < n2) + return -1; + else if (n1 > n2) + return 1; + + /* One number is "shorter", e.g., "07" vs "007" */ + if (t1-s1 < t2-s2) + return 1; + else if (t1-s1 > t2-s2) + return -1; + + /* Numbers are equal or not present, try with next ones. */ + s1 = t1; + s2 = t2; + p1 = strcspn(s1, digits); + p2 = strcspn(s2, digits); + } + + return strcmp(s1, s2); + } + #endif + /* + * Copyright (c) 2007 Albert Lee . + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * Copyright (c) 2004 Darren Tucker. + * + * Based originally on asprintf.c from OpenBSD: + * Copyright (c) 1997 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + #include "config.h" + + #ifndef HAVE_VASPRINTF + #include + #include + #include + #include + #include + + #ifndef VA_COPY + # ifdef HAVE_VA_COPY + # define VA_COPY(dest, src) va_copy(dest, src) + # else + # ifdef HAVE___VA_COPY + # define VA_COPY(dest, src) __va_copy(dest, src) + # else + # define VA_COPY(dest, src) (dest) = (src) + # endif + # endif + #endif + + #define INIT_SZ 128 + + int vasprintf(char **str, const char *fmt, va_list ap); + + int vasprintf(char **str, const char *fmt, va_list ap) + { + int ret = -1; + va_list ap2; + char *string, *newstr; + size_t len; + + VA_COPY(ap2, ap); + if ((string = malloc(INIT_SZ)) == NULL) + goto fail; + + ret = vsnprintf(string, INIT_SZ, fmt, ap2); + if (ret >= 0 && ret < INIT_SZ) { /* succeeded with initial alloc */ + *str = string; + } else if (ret == INT_MAX) { /* shouldn't happen */ + goto fail; + } else { /* bigger than initial, realloc allowing for nul */ + len = (size_t)ret + 1; + if ((newstr = realloc(string, len)) == NULL) { + free(string); + goto fail; + } else { + va_end(ap2); + VA_COPY(ap2, ap); + ret = vsnprintf(newstr, len, fmt, ap2); + if (ret >= 0 && (size_t)ret < len) { + *str = newstr; + } else { /* failed with realloc'ed string, give up */ + free(newstr); + goto fail; + } + } + } + va_end(ap2); + return (ret); + + fail: + *str = NULL; + errno = ENOMEM; + va_end(ap2); + return (-1); + } + #endif + + #ifndef HAVE_ASPRINTF + #include + #include + #include + + int asprintf(char **str, const char *fmt, ...); + + int asprintf(char **str, const char *fmt, ...) + { + va_list ap; + int ret; + + *str = NULL; + va_start(ap, fmt); + ret = vasprintf(str, fmt, ap); + va_end(ap); + + return ret; + } + #endif + + #ifndef HAVE_STRCASESTR + #include + + char *strcasestr (char *h, char *n); + + char *strcasestr (char *h, char *n) + { + char *hp, *np = n, *match = 0; + + if(!*np) { + return hp; + } + + for (hp = h; *hp; hp++) { + if (toupper(*hp) == toupper(*np)) { + if (!match) { + match = hp; + } + if(!*++np) { + return match; + } + } else { + if (match) { + match = 0; + np = n; + } + } + } + + return NULL; + } + #endif + /* + * Copyright (c) 2007 Albert Lee . + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + #include "config.h" + + #ifndef HAVE_STRNDUP + #include + #include + + char *strndup(const char *s, size_t n); + + char *strndup(const char *s, size_t n) + { + char *ns; + + n = strnlen(s, n); + + if (ns = (char *) malloc(n + 1)) { + ns[n] = '\0'; + return memcpy(ns, s, n); + } + + return NULL; + } + #endif + /* + * Copyright (c) 2007 Albert Lee . + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + #include "config.h" + + #ifndef HAVE_DAEMON + #include + #include + #include + #include + + int daemon(int nochdir, int noclose); + + int daemon(int nochdir, int noclose) + { + int fd, i; + + switch (fork()) { + case 0: + break; + case -1: + return -1; + default: + _exit(0); + } + + if (!nochdir) { + chdir("/"); + } + + if (setsid() < 0) { + return -1; + } + + if (!noclose) { + if (fd = open("/dev/null", O_RDWR) >= 0) { + for (i = 0; i < 3; i++) { + dup2(fd, i); + } + if (fd > 2) { + close(fd); + } + } + } + + return 0; + } + #endif + diff -cNr emerald-0.7.8/themer/main.c emerald-0.7.8_sol/themer/main.c *** emerald-0.7.8/themer/main.c 2008-09-17 22:29:37.000000000 +0900 --- emerald-0.7.8_sol/themer/main.c 2009-01-22 20:13:59.190189221 +0900 *************** *** 412,425 **** at = g_shell_quote(fn); g_free(fn); fn = g_shell_quote(file); ! ot = g_strdup_printf("tar -xzf %s -C %s",fn,at); if (!g_spawn_command_line_sync(ot,NULL,NULL,&ex,NULL) || (WIFEXITED(ex)&&WEXITSTATUS(ex))) { g_free(fn); g_free(ot); g_free(at); ! error_dialog("Error calling tar."); return NULL; } g_free(fn); --- 412,425 ---- at = g_shell_quote(fn); g_free(fn); fn = g_shell_quote(file); ! ot = g_strdup_printf("gtar -xzf %s -C %s",fn,at); if (!g_spawn_command_line_sync(ot,NULL,NULL,&ex,NULL) || (WIFEXITED(ex)&&WEXITSTATUS(ex))) { g_free(fn); g_free(ot); g_free(at); ! error_dialog("Error calling GNU tar."); return NULL; } g_free(fn); *************** *** 449,462 **** at = g_shell_quote(fn); g_free(fn); fn = g_shell_quote(file); ! ot = g_strdup_printf("tar -czf %s -C %s ./ --exclude=*~",fn,at); if (!g_spawn_command_line_sync(ot,NULL,NULL,&ex,NULL) || (WIFEXITED(ex)&&WEXITSTATUS(ex))) { g_free(fn); g_free(ot); g_free(at); ! error_dialog(_("Error calling tar.")); return; } g_free(ot); --- 449,462 ---- at = g_shell_quote(fn); g_free(fn); fn = g_shell_quote(file); ! ot = g_strdup_printf("gtar -czf %s -C %s ./ --exclude=*~",fn,at); if (!g_spawn_command_line_sync(ot,NULL,NULL,&ex,NULL) || (WIFEXITED(ex)&&WEXITSTATUS(ex))) { g_free(fn); g_free(ot); g_free(at); ! error_dialog(_("Error calling GNU tar.")); return; } g_free(ot);