Mercurial > MadButterfly
changeset 645:818e870e1eb5
Check if the path is absolute path. We use the default prefix only for relative path.
author | wycc |
---|---|
date | Thu, 29 Jul 2010 00:11:31 +0800 |
parents | c9f8c7e6f57e |
children | 3a1e80de44ff |
files | src/img_ldr.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/img_ldr.c Wed Jul 28 08:36:58 2010 +0800 +++ b/src/img_ldr.c Thu Jul 29 00:11:31 2010 +0800 @@ -33,7 +33,10 @@ sz = strlen(sldr->repo); sz += strlen(img_id); fname = (char *)malloc(sz + 2); - strcpy(fname, sldr->repo); + if (img_id[0] != '/') + strcpy(fname, sldr->repo); + else + fname[0] = 0; strcat(fname, img_id); surf = mbe_image_surface_create_from_png(fname);