[libbluray-devel] logging: cut path from file names
hpi1
git at videolan.org
Mon Apr 14 08:56:08 CEST 2014
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Apr 13 19:12:52 2014 +0300| [a17b2a11fa73665f1f03f3fe49ecabd76fb22653] | committer: hpi1
logging: cut path from file names
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=a17b2a11fa73665f1f03f3fe49ecabd76fb22653
---
src/util/logging.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/logging.c b/src/util/logging.c
index d465c97..2738720 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -20,6 +20,8 @@
#include "logging.h"
+#include "file/file.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
@@ -84,10 +86,11 @@ void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...
}
if (mask & debug_mask) {
+ const char *f = strrchr(file, DIR_SEP_CHAR);
char buffer[4096], *pt = buffer;
va_list args;
- pt += sprintf(buffer, "%s:%d: ", file, line);
+ pt += sprintf(buffer, "%s:%d: ", f ? f + 1 : file, line);
va_start(args, format);
vsnprintf(pt, sizeof(buffer) - (size_t)(intptr_t)(pt - buffer) - 1, format, args);
More information about the libbluray-devel
mailing list