diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2014-12-06 11:51:51 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2014-12-06 11:51:51 +0000 |
commit | b86f4cfe831b22a8e119a4a6ae9b010b2f364e89 (patch) | |
tree | 111159e37d76413735cec946208c685e7b3de6ad /main.c | |
parent | Merge branch 'bug/parsetagx-crash' (diff) | |
parent | Add README.sixel. W3M_IMG2SIXEL environmental variable enables to specify opt... (diff) | |
download | w3m-b86f4cfe831b22a8e119a4a6ae9b010b2f364e89.tar.gz w3m-b86f4cfe831b22a8e119a4a6ae9b010b2f364e89.zip |
Merge branch 'feature/remoteimg'
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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 |