diff options
-rw-r--r-- | src/utils.c | 44 | ||||
-rw-r--r-- | src/utils.h | 3 |
2 files changed, 0 insertions, 47 deletions
diff --git a/src/utils.c b/src/utils.c index e7ffa45..037010e 100644 --- a/src/utils.c +++ b/src/utils.c @@ -27,9 +27,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "debug.h" #include "options.h" -static char *feh_user_name = NULL; -static char *feh_tmp_dir = NULL; - /* eprintf: print error message and exit */ void eprintf(char *fmt, ...) { @@ -146,18 +143,6 @@ char *estrjoin(const char *separator, ...) return string; } -char *stroflen(char c, int l) -{ - static char buf[1024]; - int i = 0; - - buf[0] = '\0'; - while (l--) - buf[i++] = c; - buf[i] = '\0'; - return buf; -} - /* free the result please */ char *feh_unique_filename(char *path, char *basename) { @@ -205,32 +190,3 @@ char *ereadfile(char *path) return estrdup(buffer); } - -char *feh_get_tmp_dir(void) -{ - char *tmp; - if (feh_tmp_dir) - return feh_tmp_dir; - tmp = getenv("TMPDIR"); - if (!tmp) - tmp = getenv("TMP"); - if (!tmp) - tmp = getenv("TEMP"); - if (!tmp) - tmp = "/tmp"; - feh_tmp_dir = estrdup(tmp); - return feh_tmp_dir; -} - -char *feh_get_user_name(void) -{ - struct passwd *pw = NULL; - - if (feh_user_name) - return feh_user_name; - setpwent(); - pw = getpwuid(getuid()); - endpwent(); - feh_user_name = estrdup(pw->pw_name); - return feh_user_name; -} diff --git a/src/utils.h b/src/utils.h index d0d7665..a619a4c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -36,11 +36,8 @@ char *_estrdup(char *s); void *_emalloc(size_t n); void *_erealloc(void *ptr, size_t n); char *estrjoin(const char *separator, ...); -char *stroflen(char, int); char *feh_unique_filename(char *path, char *basename); char *ereadfile(char *path); -char *feh_get_tmp_dir(void); -char *feh_get_user_name(void); #define ESTRAPPEND(a,b) \ {\ |