mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
phar: Fix const-generic compile warnings
This commit is contained in:
@@ -46,9 +46,8 @@ static zend_class_entry *phar_ce_entry;
|
|||||||
|
|
||||||
static int phar_file_type(const HashTable *mimes, const char *file, char **mime_type) /* {{{ */
|
static int phar_file_type(const HashTable *mimes, const char *file, char **mime_type) /* {{{ */
|
||||||
{
|
{
|
||||||
char *ext;
|
|
||||||
phar_mime_type *mime;
|
phar_mime_type *mime;
|
||||||
ext = strrchr(file, '.');
|
const char *ext = strrchr(file, '.');
|
||||||
if (!ext) {
|
if (!ext) {
|
||||||
*mime_type = "text/plain";
|
*mime_type = "text/plain";
|
||||||
/* no file extension = assume text/plain */
|
/* no file extension = assume text/plain */
|
||||||
@@ -347,10 +346,9 @@ static void phar_do_404(phar_archive_data *phar, char *fname, size_t fname_len,
|
|||||||
/* post-process REQUEST_URI and retrieve the actual request URI. This is for
|
/* post-process REQUEST_URI and retrieve the actual request URI. This is for
|
||||||
cases like http://localhost/blah.phar/path/to/file.php/extra/stuff
|
cases like http://localhost/blah.phar/path/to/file.php/extra/stuff
|
||||||
which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */
|
which calls "blah.phar" file "path/to/file.php" with PATH_INFO "/extra/stuff" */
|
||||||
static void phar_postprocess_ru_web(const char *fname, size_t fname_len, const char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */
|
static void phar_postprocess_ru_web(char *fname, size_t fname_len, char *entry, size_t *entry_len, char **ru, size_t *ru_len) /* {{{ */
|
||||||
{
|
{
|
||||||
const char *e = entry + 1;
|
char *e = entry + 1, *u1 = NULL, *u = NULL, *saveu = NULL;
|
||||||
char *u = NULL, *u1 = NULL, *saveu = NULL;
|
|
||||||
size_t e_len = *entry_len - 1, u_len = 0;
|
size_t e_len = *entry_len - 1, u_len = 0;
|
||||||
phar_archive_data *pphar;
|
phar_archive_data *pphar;
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,8 @@ bool phar_is_tar(const char *buf, const char *fname) /* {{{ */
|
|||||||
tar_header *header = (tar_header *) buf;
|
tar_header *header = (tar_header *) buf;
|
||||||
uint32_t checksum = phar_tar_number(header->checksum, sizeof(header->checksum));
|
uint32_t checksum = phar_tar_number(header->checksum, sizeof(header->checksum));
|
||||||
bool is_tar;
|
bool is_tar;
|
||||||
char save[sizeof(header->checksum)], *bname;
|
char save[sizeof(header->checksum)];
|
||||||
|
const char *bname;
|
||||||
|
|
||||||
/* assume that the first filename in a tar won't begin with <?php */
|
/* assume that the first filename in a tar won't begin with <?php */
|
||||||
if (!strncmp(buf, "<?php", sizeof("<?php")-1)) {
|
if (!strncmp(buf, "<?php", sizeof("<?php")-1)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user