cvs: pecl /bcompiler bcompiler.c

From: Date: Thu, 04 Dec 2003 04:30:20 +0000
Subject: cvs: pecl /bcompiler bcompiler.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-549@lists.php.net to get a copy of this message
alan_k Wed Dec 3 23:30:20 2003 EDT Modified files: /pecl/bcompiler bcompiler.c Log: fix to is valid filename (Xavier Noguer) Index: pecl/bcompiler/bcompiler.c diff -u pecl/bcompiler/bcompiler.c:1.41 pecl/bcompiler/bcompiler.c:1.42 --- pecl/bcompiler/bcompiler.c:1.41 Wed Jun 25 01:28:54 2003 +++ pecl/bcompiler/bcompiler.c Wed Dec 3 23:30:19 2003 @@ -19,7 +19,7 @@ | Mike Bretz <mike@metropolis-ag.de> | +----------------------------------------------------------------------+ */ -/* $Id: bcompiler.c,v 1.41 2003/06/25 05:28:54 alan_k Exp $ */ +/* $Id: bcompiler.c,v 1.42 2003/12/04 04:30:19 alan_k Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -179,14 +179,19 @@ /* }}} */ static int is_valid_file_name(char *filename) -{ - int result = 1; - int len = strlen(filename); - if(len) { - result = strncasecmp(filename, "http://", 7); - result &= strncasecmp(filename + len - 1, "-", 1); + { + int len = strlen(filename); + + if (len == 0) { // empty filenames are invalid + return 0; } - return result; + if (strncasecmp(filename, "http://", 7) == 0) { + return 0; + } + if (strncmp(filename + len - 1, "-", 1) == 0) { + return 0; + } + return 1; } static inline int has_bzip2_stream_support(TSRMLS_D)

« previous php.pecl.cvs (#549) next »