cvs: php4(PHP_4_2_0) /main rfc1867.c
| From: | Zeev Suraski | Date: | Sat, 11 May 2002 11:58:53 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /main rfc1867.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11827@lists.php.net to get a copy of this message | ||
zeev Sat May 11 07:58:53 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/main rfc1867.c
Log:
MFH - avoid choking on 0 byte files
Index: php4/main/rfc1867.c
diff -u php4/main/rfc1867.c:1.94.2.3 php4/main/rfc1867.c:1.94.2.4
--- php4/main/rfc1867.c:1.94.2.3 Mon Apr 22 23:08:49 2002
+++ php4/main/rfc1867.c Sat May 11 07:58:52 2002
@@ -16,7 +16,7 @@
| Jani Taskinen <sniper@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.94.2.3 2002/04/23 03:08:49 sniper Exp $ */
+/* $Id: rfc1867.c,v 1.94.2.4 2002/05/11 11:58:52 zeev Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -33,6 +33,8 @@
#include "rfc1867.h"
+#undef DEBUG_FILE_UPLOAD
+
#define SAFE_RETURN { \
if (lbuf) efree(lbuf); \
if (abuf) efree(abuf); \
@@ -752,19 +754,19 @@
}
fclose(fp);
+#ifdef DEBUG_FILE_UPLOAD
if(strlen(filename) > 0 && total_bytes == 0) {
sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%s=%s] not saved",
param, filename);
cancel_upload = UPLOAD_ERROR_E;
}
-
- if (cancel_upload || total_bytes == 0) {
+#endif
+ if (cancel_upload) {
if (temp_filename) {
unlink(temp_filename);
efree(temp_filename);
}
temp_filename="";
-
} else {
zend_hash_add(SG(rfc1867_uploaded_files), temp_filename, strlen(temp_filename) + 1,
&temp_filename, sizeof(char *), NULL);
}