On Mon, 18 Dec 2017, Sven Schreiber wrote:
Am 18.12.2017 um 12:50 schrieb Riccardo (Jack) Lucchetti:
> On Mon, 18 Dec 2017, Riccardo (Jack) Lucchetti wrote:
>> I think the following could be a base for automatic sanitizing of sprintf
> better (preserves indentation and adds a comment)
>
> <sprintf.sed>
> s/^\([ \t]*\)sprintf \([A-Za-z_0-9]*\) \(.*\)/\1# was: sprintf \2
> \3\n\1string \2 = sprintf(\3)\n/
> </sprintf.sed>
>
> <bash>
> sed $1 -f sprintf.sed
> </bash>
>
> so for example
>
> <hansl>
> sprintf ii "%d", i-2
> </hansl>
>
> becomes
>
> <hansl>
> # was: sprintf ii "%d", i-2
> string ii = sprintf("%d", i-2)
> </nansl>
OK, very nice -- so how many packages are affected?
I have no idea :D
I could conjure up a script for (a) downloading a package (b) extracting
the hansl code (c) sanitizing it and (d) repackage, but it'd be quite a
job.
Allin, any idea on automating the process somehow?
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------