summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Gowers <00ai99@gmail.com>2013-05-06 10:56:52 +0930
committerDavid Gowers <00ai99@gmail.com>2013-05-06 10:58:29 +0930
commit4b2a378e848161d197e7eaf601c1ce6fe26b93b4 (patch)
treebbf9da549fe3e7c666a91efae9c3a39d9de60523 /src
parent8c199f28f0113b9a300ddd765e54d3999e46bc0c (diff)
Add %L format code (temporary copy of filelist)
Diffstat (limited to 'src')
-rw-r--r--src/slideshow.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/slideshow.c b/src/slideshow.c
index 65aae3d..ee461ee 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -467,8 +467,10 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
char *c;
char buf[20];
static char ret[4096];
+ char *filelist_tmppath;
ret[0] = '\0';
+ filelist_tmppath = NULL;
for (c = str; *c != '\0'; c++) {
if ((*c == '%') && (*(c+1) != '\0')) {
@@ -492,6 +494,15 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
snprintf(buf, sizeof(buf), "%d", gib_list_length(filelist));
strcat(ret, buf);
break;
+ case 'L':
+ if (filelist_tmppath != NULL) {
+ strcat(ret, filelist_tmppath);
+ } else {
+ filelist_tmppath = feh_unique_filename("/tmp/","filelist");
+ feh_write_filelist(filelist, filelist_tmppath);
+ strcat(ret, filelist_tmppath);
+ }
+ break;
case 'm':
strcat(ret, mode);
break;
@@ -589,6 +600,8 @@ char *feh_printf(char *str, feh_file * file, winwidget winwid)
} else
strncat(ret, c, 1);
}
+ if (filelist_tmppath != NULL)
+ free(filelist_tmppath);
return(ret);
}