raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=b51376f255ae9ca552224f4d9898101ae4d20987

commit b51376f255ae9ca552224f4d9898101ae4d20987
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sat Aug 20 12:36:53 2016 +0900

    rage browser - nuke silly chars from labels
---
 src/bin/browser.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/bin/browser.c b/src/bin/browser.c
index b2df3f2..99a6025 100644
--- a/src/bin/browser.c
+++ b/src/bin/browser.c
@@ -274,8 +274,24 @@ _entry_files_pop(Evas_Object *win, Entry *entry)
         else
           elm_layout_signal_emit(base, "state,normal", "rage");
         snprintf(buf, sizeof(buf), "%s", file);
-        p = strrchr(buf, '.');
-        if (p) *p = 0;
+        for (p = buf; *p; p++)
+          {
+             // nuke stupid characters from the label that may be in filename
+             if ((*p == '_') || (*p == '#') || (*p == '$') || (*p == '%') ||
+                 (*p == '*') || (*p == '+') || (*p == '[') || (*p == ']') ||
+                 (*p == ';') || (*p == '<') || (*p == '=') || (*p == '>') ||
+                 (*p == '^') || (*p == '`') || (*p == '{') || (*p == '}') ||
+                 (*p == '|') || (*p == '~') || (*p == 127) ||
+                 (*p == '\'') || (*p == '\\'))
+               {
+                  *p = ' ';
+               }
+             else if (*p == '.')
+               {
+                  *p = 0;
+                  break;
+               }
+          }
         elm_object_part_text_set(o, "rage.title", buf);
         evas_object_size_hint_weight_set(o, 0.0, 0.0);
         evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);

-- 


Reply via email to