Commit de5f1a5a by Richard Stallman

(change_newlines): Renamed from delete_newlines.

Insert a space in place of a newline.  Caller changed.

From-SVN: r3314
parent 028aaf1a
...@@ -263,7 +263,7 @@ static int compare_defs (); ...@@ -263,7 +263,7 @@ static int compare_defs ();
static int compare_token_lists (); static int compare_token_lists ();
static int eval_if_expression (); static int eval_if_expression ();
static int discard_comments (); static int discard_comments ();
static int delete_newlines (); static int change_newlines ();
static int line_for_error (); static int line_for_error ();
static int hashf (); static int hashf ();
static int file_size_and_mode (); static int file_size_and_mode ();
...@@ -7260,11 +7260,11 @@ macroexpand (hp, op) ...@@ -7260,11 +7260,11 @@ macroexpand (hp, op)
lines which don't correspond to any input line, which confuses lines which don't correspond to any input line, which confuses
gdb and gcov. */ gdb and gcov. */
if (arg->use_count > 1 && arg->newlines > 0) { if (arg->use_count > 1 && arg->newlines > 0) {
/* Don't bother doing delete_newlines for subsequent /* Don't bother doing change_newlines for subsequent
uses of arg. */ uses of arg. */
arg->use_count = 1; arg->use_count = 1;
arg->expand_length arg->expand_length
= delete_newlines (arg->expanded, arg->expand_length); = change_newlines (arg->expanded, arg->expand_length);
} }
} }
...@@ -7659,12 +7659,12 @@ discard_comments (start, length, newlines) ...@@ -7659,12 +7659,12 @@ discard_comments (start, length, newlines)
return obp - start; return obp - start;
} }
/* Delete newlines in the string of length LENGTH at START, except inside /* Turn newlines to spaces in the string of length LENGTH at START,
of string constants. The string is copied into itself with its beginning except inside of string constants.
staying fixed. */ The string is copied into itself with its beginning staying fixed. */
static int static int
delete_newlines (start, length) change_newlines (start, length)
U_CHAR *start; U_CHAR *start;
int length; int length;
{ {
...@@ -7682,11 +7682,13 @@ delete_newlines (start, length) ...@@ -7682,11 +7682,13 @@ delete_newlines (start, length)
switch (c) { switch (c) {
case '\n': case '\n':
/* If this is a NEWLINE NEWLINE, then this is a real newline in the /* If this is a NEWLINE NEWLINE, then this is a real newline in the
output. Skip past the newline and its duplicate. */ string. Skip past the newline and its duplicate.
Put a space in the output. */
if (*ibp == '\n') if (*ibp == '\n')
{ {
ibp++; ibp++;
obp--; obp--;
*obp++ = ' ';
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment