[Rd] Little memory leak fix

2018-10-29 Thread David CARLIER
Hi dear list,

Here a little memory leak fix proposal.

Kind regards.
Thanks.
Index: src/extra/tre/regexec.c
===
--- src/extra/tre/regexec.c	(revision 75507)
+++ src/extra/tre/regexec.c	(working copy)
@@ -163,9 +163,12 @@
 	{
 	  const tre_str_source *source = string;
 	  if (source->rewind == NULL || source->compare == NULL)
-	/* The backtracking matcher requires rewind and compare
-	   capabilities from the input stream. */
-	return REG_BADPAT;
+{
+  free(tags);
+	  /* The backtracking matcher requires rewind and compare
+	 capabilities from the input stream. */
+	   return REG_BADPAT;
+}
 	}
   status = tre_tnfa_run_backtrack(tnfa, string, (int)len, type,
   tags, eflags, &eo);
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] disappearing paragraphs in html rendering of text from Rd macros

2018-10-29 Thread Georgi Boshnakov
Recent changes in R-devel seem to change the HTML rendering of text returned by 
Rd macros,
in that now empty lines do not cause paragraphs to end (the empty lines are 
kept but  tags are not set).
As a result, multiple paragraphs are output as a single one.

A complete example Rd file is at: 
https://github.com/GeoBosh/reprexes/blob/master/disappearingParagraphs/a.Rd

rendered (2018-10-28) with R-devel: 
https://github.com/GeoBosh/reprexes/blob/master/disappearingParagraphs/a.html 

and R-3.5.1patched: 
https://github.com/GeoBosh/reprexes/blob/master/disappearingParagraphs/a351.html
 

The exact system information used for rendering is in the above html files. 

In essence, the following:

\newcommand{\abc}{\Sexpr[stage=build,results=rd]{paste0(letters[1:4], collapse 
= "\n\n")}}

produces in R-devel something like 

a

b

c

d

where the empty lines may be distorted in this email, while in R-3.5.1 the 
empty lines cause paragraph tags around each chunk:

a

b

c

d

Directly embedding the Sexpr in the Rd file also produces all  tags in 
R-devel and R-3.5.1patched.,

---

Georgi Boshnakov

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel