Hi,
As I am still confused about the process of including the splash screen
cdump of the png on the code in it self, I started hacking the #ifdef
DEBUG code on ap_UnixApp.cpp to load an optional splashscreen in the
~/.AbiSuite directory.
To start, I have this patch which reduces the amount of active lines of
code to create the path of the file to load. It works on my machine, but
I'd like to propose the patch before daring to submit.
Can somebody help me into it?
Hugs, rms
--
+ No matter how much you do, you never do enough -- unknown
+ Whatever you do will be insignificant,
| but it is very important that you do it -- Ghandi
+ So let's do it...?
Index: ap_UnixApp.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/unix/ap_UnixApp.cpp,v
retrieving revision 1.109
diff -r1.109 ap_UnixApp.cpp
983a984,985
>
> rms: I'm adding something here to get a localized splash screen
989a992,996
> //const char * szFile = "splash"; // remove .png so I can add lang if exists
>
> //const char * sLANG = getenv("LANG");
> const char * sLANG = NULL;
> const short iLANGsize = sLANG ? strlen(sLANG) : 0;
990a998,1000
> // rms: I got tired of reading/writing this more than once
> const unsigned short iSplashPathSize = strlen(szDirectory) +
> strlen(szFile) + iLANGsize + 4 + 2;
993c1003
< if (strlen(szDirectory) + strlen(szFile) + 2 >= PATH_MAX)
---
> if (iSplashPathSize >= PATH_MAX)
997c1007
< buf = (char *)malloc(strlen(szDirectory) + strlen(szFile) + 2);
---
> buf = (char *)malloc(iSplashPathSize);
998a1009,1014
> /* rms: I think the following LOC equals the next 5
> remember that having multiple / in a path equals
> having just one. So this is faster.
> */
> snprintf(buf, iSplashPathSize, "%s/%s", szDirectory, szFile);
> /*
1003a1020
> */
PGP signature