fixed build for getopt_long-less platforms,

removed left-over todo comments
This commit is contained in:
Hartmut Holzgraefe 2002-10-21 19:24:48 +00:00
parent 3fd56c2995
commit f768d343f5

View file

@ -1412,8 +1412,6 @@ PHP_FUNCTION(getopt)
* Get argv from the global symbol table. We calculate argc ourselves * Get argv from the global symbol table. We calculate argc ourselves
* in order to be on the safe side, even though it is also available * in order to be on the safe side, even though it is also available
* from the symbol table. * from the symbol table.
*
* TODO: Take from trackbars instead.
*/ */
if (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), if (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"),
(void **) &args) != FAILURE) { (void **) &args) != FAILURE) {
@ -1469,7 +1467,6 @@ PHP_FUNCTION(getopt)
while (zend_hash_get_current_data(Z_ARRVAL_P(p_longopts), while (zend_hash_get_current_data(Z_ARRVAL_P(p_longopts),
(void **)&arg) == SUCCESS) { (void **)&arg) == SUCCESS) {
/* TODO: check for : and ::, strip'em, efrees ... */
p->has_arg = 0; p->has_arg = 0;
name = estrdup(Z_STRVAL_PP(arg)); name = estrdup(Z_STRVAL_PP(arg));
len = strlen(name); len = strlen(name);
@ -1513,13 +1510,14 @@ PHP_FUNCTION(getopt)
#endif #endif
/* Skip unknown arguments. */ /* Skip unknown arguments. */
if (o == '?') { if (o == '?') {
// TODO bailout?
continue; continue;
} }
/* Prepare the option character and the argument string. */ /* Prepare the option character and the argument string. */
if(o == 0) { if(o == 0) {
#ifdef HAVE_GETOPT_LONG
optname = (char *)longopts[longindex].name; optname = (char *)longopts[longindex].name;
#endif
} else { } else {
if(o == 1) o = '-'; if(o == 1) o = '-';
opt[0] = o; opt[0] = o;