Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / development / compilers / as31 / 0000-getline-break.patch
blobc53f6587f8add2edfee7ff2f3c490d79679b1a9c
1 diff --git old/as31/run.c new/as31/run.c
2 index 28c5317..9e5263b 100644
3 --- old/as31/run.c
4 +++ new/as31/run.c
5 @@ -113,7 +113,8 @@ int run_as31(const char *infile, int lst, int use_stdout,
8 while (!feof(finPre)) {
9 - getline(&lineBuffer,&sizeBuf,finPre);
10 + if (getline(&lineBuffer,&sizeBuf,finPre) == -1)
11 + break;
12 if ((includePtr=strstr(lineBuffer,INC_CMD))) {
13 includePtr=includePtr+strlen(INC_CMD);
14 while ((*includePtr==' ')|| //move includePtr to filename
15 @@ -138,7 +139,8 @@ int run_as31(const char *infile, int lst, int use_stdout,
16 mesg_f("Cannot open include file: %s\n",includePtr);
17 } else {
18 while (!feof(includeFile)) {
19 - getline(&incLineBuffer,&incSizeBuf,includeFile);
20 + if (getline(&incLineBuffer,&incSizeBuf,includeFile) == -1)
21 + break;
22 fprintf(fin,"%s",incLineBuffer);
23 if (strlen(incLineBuffer)) {
24 incLineCount++;