#! /bin/sh /usr/share/dpatch/dpatch-run ## 10_expand_user_home.dpatch by Andrea Colangelo ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Expand user's home if needed. @DPATCH@ diff -urNad tuxpaint-0.9.17~/src/tuxpaint.c tuxpaint-0.9.17/src/tuxpaint.c --- tuxpaint-0.9.17~/src/tuxpaint.c 2008-03-18 16:20:45.000000000 -0400 +++ tuxpaint-0.9.17/src/tuxpaint.c 2008-03-18 16:21:05.000000000 -0400 @@ -164,7 +164,9 @@ #include #include #include - +#ifdef __linux__ +#include +#endif /* Check if features.h did its 'magic', in which case strcasestr() is likely available; if not using GNU, you can set HAVE_STRCASESTR to @@ -15930,8 +15932,16 @@ #endif else if (strstr(str, "savedir=") == str) { - savedir = strdup(str + 8); - remove_slash(savedir); + savedir = strdup(str + 8); +#ifdef __linux__ + // substitute environment variables + wordexp_t result; + wordexp(savedir, &result, 0); + free(savedir); + savedir = strdup(result.we_wordv[0]); + wordfree(&result); +#endif + remove_slash(savedir); #ifdef DEBUG printf("savedir set to: %s\n", savedir);