php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error assigning signal");
RETURN_FALSE;
}
+ zend_hash_index_del(&PCNTL_G(php_signal_table), signo);
RETURN_TRUE;
}
-
+
if (!zend_is_callable(handle, 0, &func_name TSRMLS_CC)) {
PCNTL_G(last_error) = EINVAL;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a callable function name error", func_name);
queue = next;
}
+ PCNTL_G(pending_signals) = 0;
+
/* Re-enable queue */
PCNTL_G(processing_signal_queue) = 0;
-
+
/* return signal mask to previous state */
sigprocmask(SIG_SETMASK, &old_mask, NULL);
}
break;
/* Always uses one arg */
- case 'a':
- case 'A':
- case 'Z':
- case 'h':
+ case 'a':
+ case 'A':
++ case 'Z':
+ case 'h':
case 'H':
if (currentarg >= num_args) {
efree(argv);
INC_OUTPUTPOS((arg + (arg % 2)) / 2,1) /* 4 bit per arg */
break;
- case 'a':
+ case 'a':
case 'A':
- case 'c':
+ case 'Z':
+ case 'c':
case 'C':
case 'x':
INC_OUTPUTPOS(arg,1) /* 8 bit per arg */
zval **val;
switch ((int) code) {
- case 'a':
- case 'A':
+ case 'a':
+ case 'A':
- memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg);
+ case 'Z': {
+ int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
+ memset(&output[outputpos], (code == 'a' || code == 'Z') ? '\0' : ' ', arg);
val = argv[currentarg++];
if (Z_ISREF_PP(val)) {
SEPARATE_ZVAL(val);
}
convert_to_string_ex(val);
memcpy(&output[outputpos], Z_STRVAL_PP(val),
- (Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val) : arg);
+ (Z_STRLEN_PP(val) < arg_cp) ? Z_STRLEN_PP(val) : arg_cp);
outputpos += arg;
break;
+ }
- case 'h':
+ case 'h':
case 'H': {
int nibbleshift = (code == 'h') ? 0 : 4;
int first = 1;
size = 0;
break;
- case 'a':
+ case 'a':
case 'A':
+ case 'Z':
size = arg;
arg = 1;
break;
/* get lines of text, or CRLF_CRLF */
- while( (line = get_line(self TSRMLS_CC)) && strlen(line) > 0 )
+ while( (line = get_line(self TSRMLS_CC)) && line[0] != '\0' )
{
/* add header to table */
- char *key = line;
char *value = NULL;
if (php_rfc1867_encoding_translation(TSRMLS_C)) {