From 21e6b07ce6e77cf8c5b8ced72ed91fe29777c172 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 28 Aug 2007 19:06:53 +0000 Subject: [PATCH] server/log.c (log_error_core): For APLOG_DEBUG on Unix, if __FILE__ is an absolute path (as in a VPATH build), just log the basename. Submitted by: jorton Backport: r105258 Reviewed by: wrowe, trawick, rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@570530 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 6 ------ server/log.c | 9 ++++++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/STATUS b/STATUS index 746f8fa1020..ac7ea4b35bc 100644 --- a/STATUS +++ b/STATUS @@ -152,12 +152,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK: http://people.apache.org/~wrowe/r520701-backport-2.2.patch +1: wrowe, rpluem - * server/log.c (log_error_core): For APLOG_DEBUG on Unix, if __FILE__ - is an absolute path (as in a VPATH build), just log the basename. - [Joe Orton] - http://svn.apache.org/viewvc?view=rev&revision=105258 - +1: wrowe (who can't stand this bug), trawick, rpluem - PATCHES TO BACKPORT THAT ARE ON HOLD OR NOT GOING ANYWHERE SOON: *) mod_headers: Support {...}s tag for SSL variable lookup. diff --git a/server/log.c b/server/log.c index 68de15916e4..a2a12cf5ceb 100644 --- a/server/log.c +++ b/server/log.c @@ -529,7 +529,14 @@ static void log_error_core(const char *file, int line, int level, } file = tmp; } -#endif /*_OSD_POSIX*/ +#else /* _OSD_POSIX || WIN32 */ + const char *p; + /* On Unix, __FILE__ may be an absolute path in a + * VPATH build. */ + if (file[0] == '/' && (p = ap_strrchr_c(file, '/')) != NULL) { + file = p + 1; + } +#endif /*_OSD_POSIX || WIN32 */ len += apr_snprintf(errstr + len, MAX_STRING_LEN - len, "%s(%d): ", file, line); } -- 2.47.2