- } else {
- str = (char *)new(strlen(relfil) + 5);
- }
-
- if(strcmp(relfil, "<SDCCLIB>")==0)
- {
- /*Get the built in index of a library*/
- This=buildlibraryindex_SdccLib(lbnh->libspc, libfp, str, This);
- free(str);
- break; /*get the index for next library*/
- }
-
- /*From here down, build the index for the original library
- format*/
-#ifdef SDK
-#ifdef UNIX
- if (relfil[0] == '/') {
-#else /* UNIX */
- if (relfil[0] == '\\') {
-#endif /* UNIX */
-#else /* SDK */
- if (relfil[0] == '\\') {
-#endif /* SDK */
- strcat(str,relfil+1);
- } else {
- strcat(str,relfil);
- }
- if(strchr(relfil, FSEPX) == NULL) {
-#ifdef SDK
- sprintf(&str[strlen(str)], "%co", FSEPX);
-#else /* SDK */
- sprintf(&str[strlen(str)], "%crel", FSEPX);
-#endif /* SDK */
- }
-/*3*/ if ((fp = fopen(str, "r")) != NULL) {
-
- /* Opened OK - create a new libraryfile object for it */
- This->next = (pmlibraryfile)new( sizeof( mlibraryfile ));
- if (This->next == NULL) {
- printf("panic: can't allocate memory.\n");
- exit(-1);
- }