diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2007-08-28 19:06:53 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2007-08-28 19:06:53 +0000 |
commit | 21e6b07ce6e77cf8c5b8ced72ed91fe29777c172 (patch) | |
tree | 672d3532bb21efe1bc6251d0e897e99490fd85aa /server | |
parent | 3bff84827a77d61326abc34ea8b5e963dc7a3a67 (diff) | |
download | httpd-21e6b07ce6e77cf8c5b8ced72ed91fe29777c172.tar.gz |
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
Diffstat (limited to 'server')
-rw-r--r-- | server/log.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/log.c b/server/log.c index 68de15916e..a2a12cf5ce 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); } |