From 066adcac5ee020450f94dbc5cee7a1f5a845331f Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Thu, 21 Apr 2016 01:43:27 +0100 Subject: [PATCH] dtstyle: backdrops, allow jpg/png if motif supports it add file extensions to all types but .pm/.bm. This lets XmGetPixmap() load them. --- cde/programs/dtstyle/Backdrop.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cde/programs/dtstyle/Backdrop.c b/cde/programs/dtstyle/Backdrop.c index cc7dc8c6..f95e04c4 100644 --- a/cde/programs/dtstyle/Backdrop.c +++ b/cde/programs/dtstyle/Backdrop.c @@ -737,12 +737,21 @@ ReadBitmapDirectory( filep = readdir(dirp); continue; } - - /* strip suffix off filename */ name = (char *) XtMalloc(strlen(filep->d_name) + 1); strcpy (name, filep->d_name); - (void)strtok(name, "."); + + /* strip suffix off filename if it's a .pm or .bm + * motif requires other formats like jpg, png etc to + * have the extension on to work with the XmGetPixmap() calls */ + if(strlen(name) > 3 + && (0 == strcmp(name + strlen(name) - 3, ".pm") + || 0 == strcmp(name + strlen(name) - 3, ".bm"))) + { + (void)strtok(name, "."); + } + + fprintf(stderr, "'%s'\n", name); /* check for duplicates */ duplicate = 0; -- 2.25.1