pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:1:
/* -*- c -*- || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: builtin.cmod,v 1.
246
2010/01/08 17:
55:10
srb Exp $
+
|| $Id: builtin.cmod,v 1.
247
2010/01/08
18:
17:
53
srb Exp $
*/ #include "global.h" #include "interpret.h" #include "svalue.h" #include "pike_macros.h" #include "object.h" #include "program.h" #include "array.h" #include "pike_error.h"
pike.git/src/builtin.cmod:786:
if(whitespace) if(!(wlen = whitespace->len)) REF_RETURN s; else { ws = whitespace->str; wshift = whitespace->size_shift; replspace = index_shared_string(whitespace, 0); if(replspace > 0xffff) bshift = 2; else if(replspace > 0xff && !bshift) bshift = 1;
-
if(wshift!=
bshift
) { /* convert whitespace to shift of input */
+
if(wshift!=
shift
) {
/* convert whitespace to shift of input */
PCHARP pcnws;
-
wstemp = xalloc(wlen<<
bshift
);
-
pcnws = MKPCHARP(wstemp,
bshift
);
-
if(wshift>
bshift
) {
+
wstemp = xalloc(wlen<<
shift
);
+
pcnws = MKPCHARP(wstemp,
shift
);
+
if(wshift>
shift
) {
PCHARP pcows; pcows = MKPCHARP_STR(whitespace); size_t clen = wlen, i; i = wlen = 0; do { unsigned chr = INDEX_PCHARP(pcows, i++);
-
if (chr<=0xff || chr<=0xffff &&
bshift
) /*
bshift
is 0 or 1 */
+
if (chr<=0xff || chr<=0xffff &&
shift
)
/*
shift
is 0 or 1 */
SET_INDEX_PCHARP(pcnws, wlen++, chr); } while(--clen); } else pike_string_cpy(pcnws, whitespace); ws = wstemp; } } else ws = 0;