pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1:   /*   || 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_functions.c,v 1.615 2006/03/11 17:45:37 grubba Exp $ + || $Id: builtin_functions.c,v 1.616 2006/03/13 11:55:05 grubba 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_functions.c:3305:       tmp=generic_find_binary_prefix(v[c].ind->str,    v[c].ind->len,    v[c].ind->size_shift,    str,    MINIMUM(len,v[c].ind->len),    size_shift);       if(tmp<0)    { -  int d; -  +     /* Check if we might have a valid prefix that is better than    * the current match. */    if (~tmp > match_len) {    /* We need to look closer to see if we might have a partial prefix. */    int d = c;    tmp = -tmp;    while (((d = v[d].prefix) >= a) && (v[d].ind->len > match_len)) {    if (v[d].ind->len < tmp) {    /* Found a valid prefix. */    match = d;    match_len = v[d].ind->len;    break;    }    }    }    a = c+1;    }    else if(tmp>0)    {    b=c; -  +  while ((c = v[b].prefix) > a) { +  if (v[c].ind->len < tmp) { +  if (v[c].ind->len > match_len) { +  match = c; +  match_len = v[c].ind->len;    } -  +  a = c+1; +  break; +  } +  b = c; +  } +  }    else    {    if (!v[c].is_prefix) {    return c;    }    a=c+1; /* There might still be a better match... */    match=c;    match_len = v[c].ind->len;    }    }