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.576 2004/11/27 22:48:57 mast Exp $ + || $Id: builtin_functions.c,v 1.577 2004/12/13 19:12:34 mast 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:4534: Inside #if defined(HAVE_MKTIME)
   date.tm_min=min;    date.tm_hour=hour;    date.tm_mday=mday;    date.tm_mon=mon;    date.tm_year=year;    date.tm_isdst=isdst;       /* date.tm_zone = NULL; */      #ifdef HAVE_GMTIME -  if(args > 7) +  if ((args > 7) && (Pike_sp[7-args].subtype == NUMBER_NUMBER))    {    /* UTC-relative time. Use my_timegm(). */    retval = my_timegm(&date);    if (retval == -1)    PIKE_ERROR("mktime", "Cannot convert.\n", Pike_sp, args);    retval += tz;    } else {   #endif /* HAVE_GMTIME */      #ifdef STRUCT_TM_HAS_GMTOFF
pike.git/src/builtin_functions.c:4575:    }   #endif /* STRUCT_TM_HAS___TM_GMTOFF */   #endif /* STRUCT_TM_HAS_GMTOFF */       retval = mktime(&date);       if (retval == -1)    PIKE_ERROR("mktime", "Cannot convert.\n", Pike_sp, args);      #if defined(STRUCT_TM_HAS_GMTOFF) || defined(STRUCT_TM_HAS___TM_GMTOFF) -  if(args > 7) +  if((args > 7) && (Pike_sp[7-args].subtype == NUMBER_NUMBER))    {    /* Post-adjust for the timezone.    *    * Note that tm_gmtoff has the opposite sign of timezone.    *    * Note also that it must be post-adjusted, since the gmtoff    * field is set by mktime(3).    */   #ifdef STRUCT_TM_HAS_GMTOFF    retval += tz + date.tm_gmtoff;