Changeset 677 in svn for branches/1.3/utils.c


Ignore:
Timestamp:
2009-08-28T04:53:53+02:00 (6 years ago)
Author:
Xuefer
Message:

merged r671 from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

    • Property svn:mergeinfo changed
      /trunkmerged: 671
  • branches/1.3/utils.c

    r652 r677  
    840840}
    841841/* }}} */
     842
     843#ifndef ZEND_ENGINE_2_3
     844size_t zend_dirname(char *path, size_t len) /* {{{ */
     845{
     846    php_dirname(path, len);
     847    return strlen(path);
     848}
     849/* }}} */
     850
     851long zend_atol(const char *str, int str_len) /* {{{ */
     852{
     853    long retval;
     854
     855    if (!str_len) {
     856        str_len = strlen(str);
     857    }
     858
     859    retval = strtol(str, NULL, 0);
     860    if (str_len > 0) {
     861        switch (str[str_len - 1]) {
     862        case 'g':
     863        case 'G':
     864            retval *= 1024;
     865            /* break intentionally missing */
     866        case 'm':
     867        case 'M':
     868            retval *= 1024;
     869            /* break intentionally missing */
     870        case 'k':
     871        case 'K':
     872            retval *= 1024;
     873            break;
     874        }
     875    }
     876
     877    return retval;
     878}
     879/* }}} */
     880
     881#endif
Note: See TracChangeset for help on using the changeset viewer.