]> granicus.if.org Git - php/commitdiff
Fixed bug #39548 (ZMSG_LOG_SCRIPT_NAME not routed to OutputDebugString() on Windows)
authorDmitry Stogov <dmitry@php.net>
Thu, 23 Nov 2006 08:37:34 +0000 (08:37 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 23 Nov 2006 08:37:34 +0000 (08:37 +0000)
main/main.c

index 5d730e0efc53576cda49b98ae231dc94149e518b..fa27b6aa046d500e4a3a07a6596eede46eb0e7c7 100644 (file)
@@ -1114,12 +1114,18 @@ static void php_message_handler_for_zend(long message, void *data)
                                struct tm *ta, tmbuf;
                                time_t curtime;
                                char *datetime_str, asctimebuf[52];
+                               char memory_leak_buf[4096];
 
                                time(&curtime);
                                ta = php_localtime_r(&curtime, &tmbuf);
                                datetime_str = php_asctime_r(ta, asctimebuf);
                                datetime_str[strlen(datetime_str)-1]=0; /* get rid of the trailing newline */
-                               fprintf(stderr, "[%s]  Script:  '%s'\n", datetime_str, SAFE_FILENAME(SG(request_info).path_translated));
+                               snprintf(memory_leak_buf, sizeof(memory_leak_buf), "[%s]  Script:  '%s'\n", datetime_str, SAFE_FILENAME(SG(request_info).path_translated));
+#      if defined(PHP_WIN32)
+                               OutputDebugString(memory_leak_buf);
+#      else
+                               fprintf(stderr, "%s", memory_leak_buf);
+#      endif
                        }
                        break;
        }