Skip to content

Commit

Permalink
--source option accepts file with long line (4096 caracters)
Browse files Browse the repository at this point in the history
  • Loading branch information
lathuili-home committed Jun 14, 2018
1 parent d1c77f2 commit 7938de5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions vr_exclude.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Vr_Exclude * vr_loadExcludeList (Vr_Exclude * list, const HChar * fname) {
c<line+LINE_SIZEMAX && *c != 0 && *c != '\t' && *c != ' ';
++c) {}
if (*c == 0 || c>line+LINE_SIZEMAX-1) {
VG_(umsg)("ERROR (parse)\n");
VG_(umsg)("ERROR (parse) :%s \n",line);
return list;
}
*c = 0;
Expand Down Expand Up @@ -283,7 +283,7 @@ Vr_IncludeSource * vr_loadIncludeSourceList (Vr_IncludeSource * list, const HCha
return list;
}

SizeT nLine = 256;
SizeT nLine = LINE_SIZEMAX ;
HChar *line = VG_(malloc)("vr.loadIncludeSources.1", nLine*sizeof(HChar));
Int lineno = 0;

Expand All @@ -293,29 +293,29 @@ Vr_IncludeSource * vr_loadIncludeSourceList (Vr_IncludeSource * list, const HCha
HChar* filename = line;
// Skip non-blank characters
for (c = line;
c<line+256 && *c != 0 && *c != '\t' && *c != ' ';
c<line+LINE_SIZEMAX && *c != 0 && *c != '\t' && *c != ' ';
++c) {}
if (*c == 0 || c>line+255) {
VG_(umsg)("ERROR (parse1)\n");
if (*c == 0 || c>line+LINE_SIZEMAX-1) {
VG_(umsg)("ERROR (parse1) : %s\n",line);
return list;
}
*c = 0;

// Skip blank characters
for (++c;
c<line+256 && *c != 0 && (*c == '\t' || *c == ' ');
c<line+LINE_SIZEMAX && *c != 0 && (*c == '\t' || *c == ' ');
++c) {}
HChar* linenum_ = c;
// Skip non-blank characters
for (;
c<line+256 && *c != 0 && *c != '\t' && *c != ' ';
c<line+LINE_SIZEMAX && *c != 0 && *c != '\t' && *c != ' ';
++c) {}
if (c>line+255) {
VG_(umsg)("ERROR (parse2)\n");
if (c>line+LINE_SIZEMAX-1) {
VG_(umsg)("ERROR (parse2) : %s\n",line);
return list;
}
if (*c==0) {
c = line + 256;
c = line + LINE_SIZEMAX;
} else {
*c = 0;
++c;
Expand All @@ -324,7 +324,7 @@ Vr_IncludeSource * vr_loadIncludeSourceList (Vr_IncludeSource * list, const HCha

// Skip blank characters
for (;
c<line+256 && *c != 0 && (*c == '\t' || *c == ' ');
c<line+LINE_SIZEMAX && *c != 0 && (*c == '\t' || *c == ' ');
++c) {}
HChar* fnname = c;

Expand Down

0 comments on commit 7938de5

Please sign in to comment.