forked from Imagelibrary/binutils-gdb
Fix outputdots so that it doesn't errantly discard the first line of, e.g.,
CODE_FRAGMENT. Also fix skip_past_newline to not skip past NUL. * bfd-in2.h: Regenerate. * libcoff.h: Regenerate. doc/ * chew.c (skip_past_newline_1): New function. (outputdots): Call it. (skip_past_newline): Ditto.
This commit is contained in:
@@ -265,6 +265,19 @@ skip_white_and_stars (src, idx)
|
||||
return idx;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
skip_past_newline_1 (ptr, idx)
|
||||
string_type *ptr;
|
||||
unsigned int idx;
|
||||
{
|
||||
while (at (ptr, idx)
|
||||
&& at (ptr, idx) != '\n')
|
||||
idx++;
|
||||
if (at (ptr, idx) == '\n')
|
||||
return idx + 1;
|
||||
return idx;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
string_type stack[STACK];
|
||||
@@ -603,10 +616,12 @@ outputdots ()
|
||||
|
||||
while (at (tos, idx))
|
||||
{
|
||||
if (at (tos, idx) == '\n' && at (tos, idx + 1) == '.')
|
||||
/* Every iteration begins at the start of a line. */
|
||||
if (at (tos, idx) == '.')
|
||||
{
|
||||
char c;
|
||||
idx += 2;
|
||||
|
||||
idx++;
|
||||
|
||||
while ((c = at (tos, idx)) && c != '\n')
|
||||
{
|
||||
@@ -626,11 +641,13 @@ outputdots ()
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
if (c == '\n')
|
||||
idx++;
|
||||
catchar (&out, '\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
idx++;
|
||||
idx = skip_past_newline_1 (tos, idx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1095,10 +1112,7 @@ icatstr ()
|
||||
static void
|
||||
skip_past_newline ()
|
||||
{
|
||||
while (at (ptr, idx)
|
||||
&& at (ptr, idx) != '\n')
|
||||
idx++;
|
||||
idx++;
|
||||
idx = skip_past_newline_1 (ptr, idx);
|
||||
pc++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user