From 67db80b0bbad0ec4e178b28fd2560534f9157472 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 20 Jul 2012 08:41:32 +0000 Subject: [PATCH] fix efm typebuf globbing to work for trailing globs SVN revision: 74219 --- src/bin/e_fm.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index b2499a3dd..8ec6b95d1 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -5560,10 +5560,15 @@ _e_fm2_typebuf_match(Evas_Object *obj, int next) if (!sd->icons) return NULL; tblen = strlen(sd->typebuf.buf); - tb = alloca(tblen + 2); - memcpy(tb, sd->typebuf.buf, tblen); - tb[tblen] = '*'; - tb[tblen + 1] = '\0'; + if (sd->typebuf.buf[tblen - 1] != '*') + { + tb = alloca(tblen + 2); + strncpy(tb, sd->typebuf.buf, tblen); + tb[tblen] = '*'; + tb[tblen + 1] = '\0'; + } + else + tb = strdupa(sd->typebuf.buf); if (!next) { @@ -5651,6 +5656,8 @@ _e_fm2_typebuf_char_append(Evas_Object *obj, const char *ch) strcat(ts, ch); free(sd->typebuf.buf); sd->typebuf.buf = ts; + if (ch[0] == '*') + sd->typebuf.wildcard++; _e_fm2_typebuf_match(obj, 0); if (ch[0] == '/') { @@ -5689,8 +5696,6 @@ _e_fm2_typebuf_char_append(Evas_Object *obj, const char *ch) } } } - else if (ch[0] == '*') - sd->typebuf.wildcard++; edje_object_part_text_set(sd->overlay, "e.text.typebuf_label", sd->typebuf.buf); evas_object_smart_callback_call(sd->obj, "typebuf_changed", sd->typebuf.buf); } @@ -5714,6 +5719,8 @@ _e_fm2_typebuf_char_backspace(Evas_Object *obj) if (p < 0) return; sd->typebuf.buf[p] = 0; len--; + if (dec == '*') + sd->typebuf.wildcard--; if (len) _e_fm2_typebuf_match(obj, 0); if (dec == '/') { @@ -5752,8 +5759,6 @@ _e_fm2_typebuf_char_backspace(Evas_Object *obj) } } } - else if (dec == '*') - sd->typebuf.wildcard--; edje_object_part_text_set(sd->overlay, "e.text.typebuf_label", sd->typebuf.buf); evas_object_smart_callback_call(sd->obj, "typebuf_changed", sd->typebuf.buf); }