From 34b41a3f31a3c3fbc7d7f21eb37dff9369b92202 Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Tue, 14 Oct 2008 06:13:57 +0000 Subject: [PATCH] printcommand env var parsing will need add'l work. --- docs/CHANGES.txt | 13 ++++++++----- src/tuxpaint.c | 10 ++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 31a61d224..b8a101e8e 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -70,11 +70,14 @@ $Id$ * System-Related Improvements: ---------------------------- - * 'savedir', 'datadir', 'printcommand' and 'altprintcommand' options in - configuration files (e.g., ~/.tuxpaintrc) now expand environment - variables and tildes (e.g., "~" for $HOME, or "~username" for 'username's - home directory) on Linux. (Using 'wordexp()') - NOTE: Environment variable expansion not yet supported on other platforms. + * 'savedir' and 'datadir' paths given in configuration files + (e.g., ~/.tuxpaintrc) now have any environment variables and tildes + (e.g., "~" for $HOME, or "~username" for 'username's home directory) + expanded. + NOTE: Environment variable expansion via 'wordexp()' -- currently + Linux-only. + NOTE: 'printcommand' and 'altprintcommand' options not currently parsed + for env. vars. * Build System Improvements ------------------------- diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 3c9d80d54..83f926203 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -16021,6 +16021,8 @@ static void parse_options(FILE * fi) #if !defined(WIN32) && !defined(__APPLE__) && !defined(__BEOS__) else if (strstr(str, "printcommand=") == str) { +/* FIXME: This would need to be done one argument (space-delim'd) at a time */ +/* #ifdef __linux__ wordexp_t result; char * dir = strdup(str + 13); @@ -16031,11 +16033,16 @@ static void parse_options(FILE * fi) printcommand = strdup(result.we_wordv[0]); wordfree(&result); #else +*/ printcommand = strdup(str + 13); +/* #endif +*/ } else if (strstr(str, "altprintcommand=") == str) { +/* FIXME: This would need to be done one argument (space-delim'd) at a time */ +/* #ifdef __linux__ wordexp_t result; char * dir = strdup(str + 16); @@ -16046,8 +16053,11 @@ static void parse_options(FILE * fi) altprintcommand = strdup(result.we_wordv[0]); wordfree(&result); #else +*/ altprintcommand = strdup(str + 16); +/* #endif +*/ } #endif else if (strcmp(str, "saveover=yes") == 0)