mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2024-12-28 15:58:07 +00:00
[SV #38945] Copy the entire buffer back when overwriting CR
This commit is contained in:
parent
2fc0f614be
commit
c11024b3b3
4 changed files with 12 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
|||
2013-05-26 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* read.c (readline): To be safe, move the entire buffer if we
|
||||
detect a CR. Fixes Savannah bug #38945.
|
||||
|
||||
* job.c (new_job): Compare OUT to the beginning of the OUT
|
||||
var/function, not IN. Fixes Savannah bug #39035.
|
||||
|
||||
|
|
2
read.c
2
read.c
|
@ -2542,7 +2542,7 @@ readline (struct ebuffer *ebuf)
|
|||
if ((p - start) > 1 && p[-2] == '\r')
|
||||
{
|
||||
--p;
|
||||
p[-1] = '\n';
|
||||
memmove (p-1, p, strlen (p) + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
2013-05-26 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/misc/bs-nl: Test for Savannah bug #39035.
|
||||
Add a test for Savannah bug #38945.
|
||||
|
||||
2013-05-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
|
|
|
@ -114,10 +114,15 @@ t:; @$(call f,"a \
|
|||
my $m1 = get_tmpfile();
|
||||
open(MAKEFILE, "> $m1");
|
||||
binmode(MAKEFILE);
|
||||
print MAKEFILE "FOO = foo \\\r\nbar\nall: ; \@echo \$(FOO)\n";
|
||||
print MAKEFILE "FOO = foo \\\r\n";
|
||||
close(MAKEFILE);
|
||||
|
||||
run_make_with_options($m1, '', get_logfile());
|
||||
my $m2 = get_tmpfile();
|
||||
open(MAKEFILE, "> $m2");
|
||||
print MAKEFILE "include $m1\ndefine BAR\nall: ; \@echo \$(FOO) bar\nendef\n\$(eval \$(BAR))\n";
|
||||
close(MAKEFILE);
|
||||
|
||||
run_make_with_options($m2, '', get_logfile());
|
||||
compare_output("foo bar\n", get_logfile(1));
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue