From Richard.Cotton at hsl.gov.uk  Wed Jan 16 11:32:23 2008
From: Richard.Cotton at hsl.gov.uk (Richard Cotton)
Date: Wed, 16 Jan 2008 02:32:23 -0800 (PST)
Subject: [Rd] %s in filename when opening device causes crash (PR#10571)
In-Reply-To: <Pine.LNX.4.64.0801141824520.12548@gannet.stats.ox.ac.uk>
References: <20080114145006.C745B2834629@mail.pubhealth.ku.dk>
	<20080114175023.B5B242834612@mail.pubhealth.ku.dk>
	<478BA787.8060806@biostat.ku.dk>
	<Pine.LNX.4.64.0801141824520.12548@gannet.stats.ox.ac.uk>
Message-ID: <14877649.post@talk.nabble.com>




Prof Brian Ripley wrote:
> 
>> Yes. The problem is of course that we do want a sprintf() format there
>> for "Rplot%03d.pdf" et al. One  option would be to escape "%" except
>> when in (regexp) "%[0-9]*d", which seems nontrivial, but not impossible.
> 
> But there are other integer formats (%i, %u, %x, %X), and other flags (# 
> might be useful).  So the list of valid inputs is also rather long.  It 
> would be tedious to do at C level, but a check in the R-level wrapper 
> would be easier (if not 'simple').
> 

Having just worked my way through the alphabet, I can say that it is only
the letters 's' and 'n' that cause any problems.  Thus, if you do decide to
handle the error in the R wrapper functions, the regex for bad inputs is
fairly straightforward "%[#[:blank:]\\+\\-]*[[:digit:]]*[sn]".
-- 
View this message in context: http://www.nabble.com/-s-in-filename-when-opening-device-causes-crash-%28PR-10571%29-tp14806982p14877649.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] %s in filename when opening device causes crash (PR#10571)
Richard Cotton