From 9b6a3f62be73fbc61d312fa355a7c711f5ff3461 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 26 Sep 2003 21:58:11 +0000 Subject: [project @ 2003-09-26 21:58:11 by jmb] Improve image filename discovery svn path=/import/netsurf/; revision=319 --- riscos/about.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'riscos') diff --git a/riscos/about.c b/riscos/about.c index 0455e3676..65cc5c517 100644 --- a/riscos/about.c +++ b/riscos/about.c @@ -109,7 +109,7 @@ void about_create(void) { struct plugd *temp; FILE *fp; char *buf, *val, var[20], *ptype, *pdetails, *fname, *furl, *p, *leafname; - int i, nofiles, j, w, h, size; + int i, nofiles, j, w, h, size, pneeded; os_fw fh; os_error *e; @@ -198,11 +198,13 @@ void about_create(void) { } else { /* Type 3: image file with name xxwwwwhhhh */ - /* get actual file name - isn't there an easier way? */ - fname = xcalloc(strlen(buf)+40, sizeof(char)); - xosfind_openinw(osfind_NO_PATH, buf, 0, &fh); - xosargs_read_pathw(fh, fname, (int)strlen(buf)+10,0); - xosfind_closew(fh); + /* get actual file name */ + sprintf(var, "%2.2d*", j); + sprintf(buf, "%s.", val); + xosfscontrol_canonicalise_path(var, 0, 0, buf, 0, &pneeded); + fname = xcalloc((10-pneeded), sizeof(char)); + xosfscontrol_canonicalise_path(var, fname, 0, buf, + (10-pneeded), 0); furl = xcalloc(strlen(fname) + 20, sizeof(char)); -- cgit v1.2.3