summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2011-09-26 16:05:16 +0200
committerportix <portix@gmx.net>2011-09-26 16:05:16 +0200
commit3dc92c3d4e81f64a64cfb965e30fc6fa8479143a (patch)
treed3fd2ed5310aa7b35933a64ff152ab980a0c35ba /src/util.c
parentccbb7506dca368b9ede7cd5d26acd9c9ed9d3022 (diff)
downloaddwb-3dc92c3d4e81f64a64cfb965e30fc6fa8479143a.zip
Check if editor is set, prefix for temp-cache-files
--HG-- branch : develop
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 895646c3..185908ee 100644
--- a/src/util.c
+++ b/src/util.c
@@ -21,11 +21,11 @@
/* util_string_replace(const char *haystack, const char *needle, const char *replace) return: char * (alloc){{{*/
char *
-util_get_temp_filename(void) {
+util_get_temp_filename(const char *prefix) {
struct timeval t;
gettimeofday(&t, NULL);
const char *path = g_get_user_cache_dir();
- char *filename = g_strdup_printf("edit%lu", t.tv_usec + t.tv_sec*1000000);
+ char *filename = g_strdup_printf("%s%lu", prefix, t.tv_usec + t.tv_sec*1000000);
char *cache_path = g_build_filename(path, dwb.misc.name, filename, NULL);
g_free(filename);