diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-16 19:02:12 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-16 19:02:12 +0000 |
commit | 970d17ca4c52b32186910059bca87f8e6424050b (patch) | |
tree | 6733507b99f2542c424c5a9eb309c5c4ffca0e20 /search.c | |
parent | [w3m-dev 02861] IPv6 configuration check (diff) | |
download | w3m-970d17ca4c52b32186910059bca87f8e6424050b.tar.gz w3m-970d17ca4c52b32186910059bca87f8e6424050b.zip |
[w3m-dev 02862] SIGPIPE for migemo support
* main.c (SigPipe): added
* main.c (MAIN): signal(SIGPIPE, )
* search.c: #include <errno.h>
* search.c (migemostr): check fflush() error
* search.c (migemostr): check result string (empty is err)
* search.c (migemostr): if error occured, disable use_migemo
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to 'search.c')
-rw-r--r-- | search.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -1,6 +1,7 @@ -/* $Id: search.c,v 1.9 2002/01/16 16:49:55 ukai Exp $ */ +/* $Id: search.c,v 1.10 2002/01/16 19:02:16 ukai Exp $ */ #include "fm.h" #include "regex.h" +#include <errno.h> static void set_mark(Line *l, int pos, int epos) @@ -71,10 +72,23 @@ migemostr(char *str) if (open_migemo(migemo_command) == 0) return str; fprintf(migemow, "%s\n", str); - fflush(migemow); +again: + if (fflush(migemow) != 0) { + switch (errno) { + case EINTR: goto again; + default: goto err; + } + } tmp = Strfgets(migemor); Strchop(tmp); + if (tmp->length == 0) + goto err; return tmp->ptr; +err: + /* XXX: backend migemo is not working? */ + init_migemo(); + use_migemo = 0; + return str; } #endif /* USE_MIGEMO */ |