as31-fix-duplicate-line.patch 884 B

12345678910111213141516171819202122232425
  1. diff --git a/as31/run.c b/as31/run.c
  2. index 28c5317..9e5263b 100644
  3. --- a/as31/run.c
  4. +++ b/as31/run.c
  5. @@ -113,7 +113,8 @@ int run_as31(const char *infile, int lst, int use_stdout,
  6. }
  7. while (!feof(finPre)) {
  8. - getline(&lineBuffer,&sizeBuf,finPre);
  9. + if (getline(&lineBuffer,&sizeBuf,finPre) == -1)
  10. + break;
  11. if ((includePtr=strstr(lineBuffer,INC_CMD))) {
  12. includePtr=includePtr+strlen(INC_CMD);
  13. while ((*includePtr==' ')|| //move includePtr to filename
  14. @@ -138,7 +139,8 @@ int run_as31(const char *infile, int lst, int use_stdout,
  15. mesg_f("Cannot open include file: %s\n",includePtr);
  16. } else {
  17. while (!feof(includeFile)) {
  18. - getline(&incLineBuffer,&incSizeBuf,includeFile);
  19. + if (getline(&incLineBuffer,&incSizeBuf,includeFile) == -1)
  20. + break;
  21. fprintf(fin,"%s",incLineBuffer);
  22. if (strlen(incLineBuffer)) {
  23. incLineCount++;