From: jesusc Date: Fri, 25 Jul 2003 23:12:04 +0000 (+0000) Subject: Solved some issues with cygwin paths again... X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=1af64a1ba77ae0a8b595795b912d94bd10011bce;p=fw%2Fsdcc Solved some issues with cygwin paths again... git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2776 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/link/z80/lklibr.c b/link/z80/lklibr.c index 9aa090ef..47f499f3 100644 --- a/link/z80/lklibr.c +++ b/link/z80/lklibr.c @@ -27,6 +27,16 @@ #include #include "aslink.h" +#ifdef __CYGWIN__ +void ToCygWin(char * filspc) +{ + char posix_path[PATH_MAX]; + void cygwin_conv_to_full_posix_path(char * win_path, char * posix_path); + cygwin_conv_to_full_posix_path(filspc, posix_path); + strcpy(filspc, posix_path); +} +#endif + /*)Module lklibr.c * * The module lklibr.c contains the functions which @@ -459,6 +469,7 @@ int fndsym( char *name ) ThisSym = ThisLibr->symbols->next; while (ThisSym) { + //printf("ThisSym->name=%s\n", ThisSym->name); if (!strcmp(ThisSym->name, name)) { if (!ThisLibr->loaded) { /* Object file is not loaded - add it to the list */ @@ -1039,6 +1050,10 @@ void loadfile_SdccLib(char * libspc, char * module, long offset) { FILE *fp; +#ifdef __CYGWIN__ + ToCygWin(libspc); +#endif + if ((fp = fopen(libspc,"r")) != NULL) { fseek(fp, offset, SEEK_SET); @@ -1118,6 +1133,10 @@ char *filspc; char str[NINPUT+2]; int i; +#ifdef __CYGWIN__ + ToCygWin(filspc); +#endif + if ((fp = fopen(filspc,"r")) != NULL) { while (fgets(str, NINPUT, fp) != NULL) { str[NINPUT+1] = '\0'; @@ -1129,4 +1148,9 @@ char *filspc; } fclose(fp); } + else + { + printf("Couldn't find file %s\n", filspc); + exit(-4); + } }