Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1
w3m
w3m-tempdir-override.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File w3m-tempdir-override.patch of Package w3m
--- rc.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) --- a/rc.c +++ b/rc.c @@ -1182,7 +1182,16 @@ sync_with_option(void) #endif /* MENU */ } } - +static char *get_tmp_dir(void) +{ + char *_tmp_dir; + if (((_tmp_dir = getenv("TMPDIR")) == NULL || *_tmp_dir == '\0') && + ((_tmp_dir = getenv("TMP")) == NULL || *_tmp_dir == '\0') && + ((_tmp_dir = getenv("TEMP")) == NULL || *_tmp_dir == '\0')) + _tmp_dir = NULL; + _tmp_dir = expandPath(_tmp_dir); + return _tmp_dir; +} void init_rc(void) { @@ -1190,9 +1199,11 @@ init_rc(void) struct stat st; FILE *f; + tmp_dir = get_tmp_dir(); if (rc_dir != NULL) goto open_rc; + no_rc_dir = TRUE; rc_dir = expandPath(RC_DIR); i = strlen(rc_dir); if (i > 1 && rc_dir[i - 1] == '/') @@ -1229,7 +1240,6 @@ init_rc(void) goto rc_dir_err; } no_rc_dir = FALSE; - tmp_dir = rc_dir; if (config_file == NULL) config_file = rcFile(CONFIG_FILE); @@ -1250,13 +1260,12 @@ init_rc(void) interpret_rc(f); fclose(f); } + if (!tmp_dir) + tmp_dir = rc_dir; return; rc_dir_err: - no_rc_dir = TRUE; - if (((tmp_dir = getenv("TMPDIR")) == NULL || *tmp_dir == '\0') && - ((tmp_dir = getenv("TMP")) == NULL || *tmp_dir == '\0') && - ((tmp_dir = getenv("TEMP")) == NULL || *tmp_dir == '\0')) + if (!tmp_dir) tmp_dir = "/tmp"; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor