Skip to content

Instantly share code, notes, and snippets.

@Girgias
Created January 23, 2020 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Girgias/f03ae14ffa5f2f8bc8ae81ef66b06743 to your computer and use it in GitHub Desktop.
Save Girgias/f03ae14ffa5f2f8bc8ae81ef66b06743 to your computer and use it in GitHub Desktop.
spprintf custom format grep
george@DESKTOP-GEORGE-P:/mnt/c/Dev/php-src$ grep -rPbnH "(v)?s(tr)?pprintf\(.*%(\+|-| |#|0)?(\d+|\*)?(\.(\d+|\*))?(h|H|k|v|t|j|z|Z|l|L|I).*\)"
ext/ffi/ffi.c:798:21768: return strpprintf(0, "@%s@%zu", ZSTR_VAL(name), zend_ffi_arg_size(type));
ext/ffi/ffi.c:802:21898: return strpprintf(0, "_%s@%zu", ZSTR_VAL(name), zend_ffi_arg_size(type));
ext/ffi/ffi.c:806:22050: return strpprintf(0, "%s@@%zu", ZSTR_VAL(name), zend_ffi_arg_size(type));
ext/pdo_odbc/odbc_driver.c:42:1567: message = strpprintf(0, "%s (%s[%ld] at %s:%d)",
ext/phar/phar.c:2467:69708: spprintf(error, 0, "Illegal filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed", index_len);
ext/phar/phar.c:2475:69976: spprintf(error, 0, "Illegal web filename passed in for stub creation, was %zd characters long, and only 400 or less is allowed", web_len);
ext/spl/php_spl.c:849:27082: return strpprintf(32, "%016zx%016zx", hash_handle, hash_handlers);
ext/standard/microtime.c:79:2362: RETURN_NEW_STR(zend_strpprintf(0, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, (long)tp.tv_sec));
sapi/phpdbg/phpdbg_opcode.c:71:2610: spprintf(&result, 0, "J%td", OP_JMP_ADDR(opline, op) - ops->opcodes);
sapi/phpdbg/phpdbg_prompt.c:153:6652: spprintf(&buffered, 0, "%s::%s#%ld", next->method.class, next->method.name, next->num);
sapi/phpdbg/phpdbg_prompt.c:158:6845: spprintf(&buffered, 0, "%s#%ld", next->str, next->num);
sapi/phpdbg/phpdbg_prompt.c:163:6994: spprintf(&buffered, 0, "%s:%ld", next->file.name, next->file.line);
sapi/phpdbg/phpdbg_prompt.c:168:7163: spprintf(&buffered, 0, "%s:#%ld", next->file.name, next->file.line);
george@DESKTOP-GEORGE-P:/mnt/c/Dev/php-src$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment