From b55b89219846b50f99a93dd26d795d4df71600a7 Mon Sep 17 00:00:00 2001 From: Platon Fomichev Date: Thu, 11 Jan 2001 22:47:32 +0000 Subject: [PATCH] OS/2 fixes SVN revision: 4113 --- loaders/loader_db.c | 16 ++++++---------- loaders/loader_xpm.c | 4 ++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/loaders/loader_db.c b/loaders/loader_db.c index 5a3124f..fba6f20 100644 --- a/loaders/loader_db.c +++ b/loaders/loader_db.c @@ -81,17 +81,15 @@ load (ImlibImage *im, ImlibProgressFunction progress, char file[4096], key[4096], *ptr; DATA32 *ret; DATA32 *body; - if (im->data) return 0; if (!im->file) return 0; strcpy(file, im->file); #ifdef __EMX__ - if ( (isalpha((int)file[0])) && (file[1]==':') && - ((file[2]=='\\') || (file[2]=='/'))) - ptr = strchr(file, ':'); - if (ptr) ptr=strrchr(++ptr, ':'); + ptr = strrchr(file, ':'); + /* if colon is chars 0, 1, or 2 it might be a drive letter for os/2 */ + if ((ptr) && (ptr - file) < 3) ptr=strrchr(++ptr, ':'); #else ptr = strrchr(file, ':'); #endif @@ -106,7 +104,6 @@ load (ImlibImage *im, ImlibProgressFunction progress, db = e_db_open_read(file); if (!db) return 0; - ret = e_db_data_get(db, key, &size); if (!ret) { @@ -284,10 +281,9 @@ save (ImlibImage *im, ImlibProgressFunction progress, return 0; strcpy(file, im->file); #ifdef __EMX__ - if ( (isalpha((int)file[0])) && (file[1]==':') && - ((file[2]=='\\') || (file[2]=='/'))) - cp = strchr(file, ':'); - if (cp) cp=strrchr(++cp, ':'); + cp = strrchr(file, ':'); + /* if colon is chars 0, 1, or 2 it might be a drive letter for os/2 */ + if ((cp) && (cp - file) < 3) cp = strrchr(++cp, ':'); #else cp = strrchr(file, ':'); #endif diff --git a/loaders/loader_xpm.c b/loaders/loader_xpm.c index f2178b1..616f202 100644 --- a/loaders/loader_xpm.c +++ b/loaders/loader_xpm.c @@ -62,7 +62,11 @@ xpm_parse_color(char *color, int *r, int *g, int *b) } /* look in rgb txt database */ if (!rgb_txt) +#ifndef __EMX__ rgb_txt = fopen("/usr/X11R6/lib/X11/rgb.txt", "r"); +#else + rgb_txt = fopen(__XOS2RedirRoot("/XFree86/lib/X11/rgb.txt"), "rt"); +#endif if (!rgb_txt) return; fseek(rgb_txt, 0, SEEK_SET);