comparison src/img_ldr.c @ 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 a417fd980228
children 586e50f82c1f
comparison
equal deleted inserted replaced
644:c9f8c7e6f57e 645:818e870e1eb5
31 int sz; 31 int sz;
32 32
33 sz = strlen(sldr->repo); 33 sz = strlen(sldr->repo);
34 sz += strlen(img_id); 34 sz += strlen(img_id);
35 fname = (char *)malloc(sz + 2); 35 fname = (char *)malloc(sz + 2);
36 strcpy(fname, sldr->repo); 36 if (img_id[0] != '/')
37 strcpy(fname, sldr->repo);
38 else
39 fname[0] = 0;
37 strcat(fname, img_id); 40 strcat(fname, img_id);
38 41
39 surf = mbe_image_surface_create_from_png(fname); 42 surf = mbe_image_surface_create_from_png(fname);
40 if(surf == NULL) 43 if(surf == NULL)
41 return NULL; 44 return NULL;