From: Gurusamy Sarathy Date: Wed, 9 Oct 1996 03:54:47 +0000 (-0400) Subject: Re: Sorting lists of integers doesn't always work X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6bf554b4f0803e34bfc05c3750580299121acab2;p=p5sagit%2Fp5-mst-13.2.git Re: Sorting lists of integers doesn't always work >> > print sort (4,1,2,3); >> > >> > actually prints "4123", i.e. doesn't actually sort. Bug? Feature? This broke between 5.001n and 5.002. There was a long winded thread about sorting undefs in some order (rather than coredumping) around the 5.002beta times (search for "bogorefs" in the subject-line on p5p archive for details). Larry added in some code that presumes that the private flags are set by the time qsort() is called: Unfortunately, sv_2pv() does not set the POKp flag, so the above code breaks! Here's a patch against 5.00306. --- diff --git a/sv.c b/sv.c index b155eee..0af82f7 100644 --- a/sv.c +++ b/sv.c @@ -1517,7 +1517,7 @@ STRLEN *lp; s = SvGROW(sv, len + 1); SvCUR_set(sv, len); (void)strcpy(s, tokenbuf); - /* NO SvPOK_on(sv) here! */ + SvPOKp_on(sv); return s; } }