aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2014-12-06 11:51:51 +0000
committerTatsuya Kinoshita <tats@debian.org>2014-12-06 11:51:51 +0000
commitb86f4cfe831b22a8e119a4a6ae9b010b2f364e89 (patch)
tree111159e37d76413735cec946208c685e7b3de6ad /main.c
parentMerge branch 'bug/parsetagx-crash' (diff)
parentAdd README.sixel. W3M_IMG2SIXEL environmental variable enables to specify opt... (diff)
downloadw3m-b86f4cfe831b22a8e119a4a6ae9b010b2f364e89.tar.gz
w3m-b86f4cfe831b22a8e119a4a6ae9b010b2f364e89.zip
Merge branch 'feature/remoteimg'
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/main.c b/main.c
index c8f1e82..32f4da2 100644
--- a/main.c
+++ b/main.c
@@ -122,6 +122,8 @@ static int searchKeyNum(void);
#define help() fusage(stdout, 0)
#define usage() fusage(stderr, 1)
+int enable_inline_image; /* 1 == mlterm OSC 5379, 2 == sixel */
+
static void
fversion(FILE * f)
{
@@ -409,7 +411,6 @@ main(int argc, char **argv, char **envp)
#if defined(DONT_CALL_GC_AFTER_FORK) && defined(USE_IMAGE)
char **getimage_args = NULL;
#endif /* defined(DONT_CALL_GC_AFTER_FORK) && defined(USE_IMAGE) */
-
GC_INIT();
#if defined(ENABLE_NLS) || (defined(USE_M17N) && defined(HAVE_LANGINFO_CODESET))
setlocale(LC_ALL, "");
@@ -679,6 +680,12 @@ main(int argc, char **argv, char **envp)
}
}
#endif
+ else if (!strcmp("-ri", argv[i])) {
+ enable_inline_image = 1;
+ }
+ else if (!strcmp("-sixel", argv[i])) {
+ enable_inline_image = 2;
+ }
else if (!strcmp("-num", argv[i]))
showLineNum = TRUE;
else if (!strcmp("-no-proxy", argv[i]))
@@ -5910,8 +5917,14 @@ deleteFiles()
Firstbuf = buf;
}
}
- while ((f = popText(fileToDelete)) != NULL)
+ while ((f = popText(fileToDelete)) != NULL) {
unlink(f);
+ if (enable_inline_image == 2 && strcmp(f+strlen(f)-4, ".gif") == 0) {
+ Str firstframe = Strnew_charp(f);
+ Strcat_charp(firstframe, "-1");
+ unlink(firstframe->ptr);
+ }
+ }
}
void