* support/librarian/sdcclib.c:
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 26 Dec 2008 23:03:42 +0000 (23:03 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 26 Dec 2008 23:03:42 +0000 (23:03 +0000)
  fixed bug 2466950: "sdcclib broken"
  by removing fgets return value check

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5302 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
support/librarian/sdcclib.c

index 56ad49cae70a8495b976f899f340144eaa998e29..ef1b9c21e4bdcee78ebda71c09fb71e4a72ac126 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-26 Borut Razem <borut.razem AT siol.net>
+
+       * support/librarian/sdcclib.c:
+         fixed bug 2466950: "sdcclib broken"
+         by removing fgets return value check
+
 2008-12-26 Philipp Klaus Krause <pkk AT spth.de>
        * src/z80/main.c,
          src/z80/gen.c,
index 48e13e8b1873b4f2612909533c9976acdde16497..5ab4c4a5b34dd9d111f6ce7f74d396eabd061901 100644 (file)
@@ -51,12 +51,6 @@ int NumRelFiles=0;
 #if 1
 #include <assert.h>
 
-#define fgets(S, SIZE, STREAM)  do {                    \
-  char *__s4567 = S;                                    \
-  char *__res4567 = fgets(__s4567, SIZE, STREAM);       \
-  assert(__s4567 == __res4567);                         \
-} while (0)
-
 #define system(CMD)             do {                    \
   int __res4568 = system(CMD);                          \
   assert(-1 != __res4568);                              \
@@ -317,7 +311,7 @@ void AddRel(char * RelName)
                         fprintf(libindex, "<MODULE>\n%s %ld\n", FLine, newlibpos);
                         state++;
                     }
-                }                
+                }
             break;
             case 1:
                 fprintf(newlib, "%s\n", FLine);
@@ -365,7 +359,7 @@ void AddRel(char * RelName)
         fclose(rel);
         fprintf(libindex, "</MODULE>\n");
         fprintf(newlib, "</REL>\n<ADB>\n");
-    
+
         adb=fopen(AdbName, "r");
         if(adb!=NULL)
         {
@@ -482,7 +476,7 @@ void ExtractRel(char * RelName)
                     fgets(FLine, MAXLINE, lib);
                     CleanLine(FLine);
                     if(EQ(FLine, ModName)) state=1;
-                }                
+                }
             break;
             case 1:
                 if(EQ(FLine, "<REL>")) state=2;
@@ -501,10 +495,10 @@ void ExtractRel(char * RelName)
                     state=5;
                 else
                     fprintf(adb, "%s\n", FLine);
-            break; 
+            break;
         }
     }
-    
+
     fclose(rel);
     fclose(lib);
     fclose(adb);
@@ -526,10 +520,10 @@ void DumpSymbols(void)
     CleanLine(FLine);
     if(NEQ(FLine, "<SDCCLIB>"))
     {
-        printf("ERROR: File '%s' was not created with '%s'\n", LibName, ProgName); 
+        printf("ERROR: File '%s' was not created with '%s'\n", LibName, ProgName);
         return;
     }
-    
+
     while(!feof(lib))
     {
         if(state==3) break;
@@ -574,14 +568,14 @@ void DumpSymbols(void)
             break;
         }
     }
-    
+
     fclose(lib);
 }
 
 int fileexist(char * fname)
 {
     FILE * fp;
-    
+
     fp=fopen(fname, "r");
     if(fp==NULL) return 0;
     fclose(fp);
@@ -675,7 +669,7 @@ int main(int argc, char **argv)
             for(j=0; j<NumRelFiles; j++) free(RelName[j]);
             free(RelName);
         break;
-        
+
         case OPT_ADD_LIST:
             AddList();
         break;
@@ -686,7 +680,7 @@ int main(int argc, char **argv)
             for(j=0; j<NumRelFiles; j++) free(RelName[j]);
             free(RelName);
         break;
-        
+
         case OPT_DUMP_SYM:
         case OPT_DUMP_MOD:
             DumpSymbols();