pike.git / src / mapping.c

version» Context lines:

pike.git/src/mapping.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: mapping.c,v 1.99 2000/09/03 23:18:46 mast Exp $"); + RCSID("$Id: mapping.c,v 1.100 2000/09/07 11:31:05 grubba Exp $");   #include "main.h"   #include "object.h"   #include "mapping.h"   #include "svalue.h"   #include "array.h"   #include "pike_macros.h"   #include "error.h"   #include "pike_memory.h"   #include "dynamic_buffer.h"   #include "interpret.h"
pike.git/src/mapping.c:1546:    for(e=0;p;e++,p=p->next)    {    if(p->pointer_a == (void *)m)    {    sprintf(buf,"@%ld",(long)e);    my_strcat(buf);    return;    }    }    -  sprintf(buf, m->data->size == 1 ? "([ /* %ld element */\n" : -  "([ /* %ld elements */\n", -  (long)m->data->size); +  if (m->data->size == 1) { +  my_strcat("([ /* 1 element */\n"); +  } else { +  sprintf(buf, "([ /* %ld elements */\n", (long)m->data->size);    my_strcat(buf); -  +  }       a = mapping_indices(m);    SET_ONERROR(err, do_free_array, a);       if(!SETJMP(catch))    sort_array_destructively(a);    UNSETJMP(catch);       /* no mapping locking required (I hope) */    for(e = 0; e < a->size; e++)