version 1.72 | | version 1.73 |
---|
| | |
/* | | /* |
* static char *rcsid_main_c = | | * static char *rcsid_main_c = |
* "$Id: main.c,v 1.72 2003/01/08 08:39:20 mwedel Exp $"; | | * "$Id: main.c,v 1.73 2003/01/17 07:07:14 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* Take the last component (after the last slash) to give | | * Take the last component (after the last slash) to give |
* shorter names without bogus slashes. | | * shorter names without bogus slashes. |
*/ | | */ |
cp = strrchr(rp.final_map[0]? rp.final_map:rp.origin_map, '/'); | | if (rp.final_map[0]) { |
if (!cp) | | cp = strrchr(rp.final_map, '/'); |
cp = rp.final_map[0]? rp.final_map:rp.origin_map; | | if (!cp) cp = rp.final_map; |
| | } else { |
| | char buf[HUGE_BUF]; |
| | |
| | cp = strrchr(rp.origin_map, '/'); |
| | if (!cp) cp = rp.origin_map; |
| | /* Need to strip of any trailing digits, if it has them */ |
| | strcpy(buf, cp); |
| | while (isdigit(buf[strlen(buf) - 1])) |
| | buf[strlen(buf) - 1] = 0; |
| | cp = buf; |
| | } |
| | |
sprintf(newmap_name,"/random/%s%04d",cp+1, reference_number++); | | sprintf(newmap_name,"/random/%s%04d",cp+1, reference_number++); |
| | |