evas xpm loader - add more rgb.txt file locations...
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 8 Jun 2017 03:11:43 +0000 (12:11 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 8 Jun 2017 03:11:43 +0000 (12:11 +0900)
2 more. /etc/X11/rgb.txt /usr/share/vim/vim80/rgb.txt  ...what i do notice
is that this file seems to have vanished from modern systems... so we'll have
lots of un-fun loading old xpm's with colornames if we cant figure out what
color names map to what colors...

src/modules/evas/image_loaders/xpm/evas_image_load_xpm.c

index 4957956..e219982 100644 (file)
@@ -707,10 +707,12 @@ module_open(Evas_Module *em)
      }
 
    /* Shouldn't we make that PATH configurable ? */
-   rgb_txt = eina_file_open("/usr/lib/X11/rgb.txt", 0);
+   rgb_txt = eina_file_open("/etc/X11/rgb.txt", 0);
+   if (!rgb_txt) rgb_txt = eina_file_open("/usr/lib/X11/rgb.txt", 0);
    if (!rgb_txt) rgb_txt = eina_file_open("/usr/X11/lib/X11/rgb.txt", 0);
    if (!rgb_txt) rgb_txt = eina_file_open("/usr/X11R6/lib/X11/rgb.txt", 0);
    if (!rgb_txt) rgb_txt = eina_file_open("/usr/openwin/lib/X11/rgb.txt", 0);
+   if (!rgb_txt) rgb_txt = eina_file_open("/usr/share/vim/vim80/rgb.txt", 0);
    if (rgb_txt)
      rgb_txt_map = eina_file_map_all(rgb_txt, EINA_FILE_WILLNEED);
    em->functions = (void *)(&evas_image_load_xpm_func);