summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-03-11 19:56:16 +0000
committerjhb <jhb@FreeBSD.org>2003-03-11 19:56:16 +0000
commit559c6447408830588980b10f618737131339474f (patch)
treedfbfafcff5f5b7b1399e988661e526c0349c10b1 /sys/kern
parent8e6ed1abea665969ab1acf8bb791d699c90498f5 (diff)
downloadFreeBSD-src-559c6447408830588980b10f618737131339474f.zip
FreeBSD-src-559c6447408830588980b10f618737131339474f.tar.gz
Trim leading "../" sequences from filenames.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_ktr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c
index fc14663..35a15fd 100644
--- a/sys/kern/kern_ktr.c
+++ b/sys/kern/kern_ktr.c
@@ -216,6 +216,9 @@ ktr_tracepoint(u_int mask, const char *file, int line, const char *format,
#endif
entry->ktr_timestamp = KTR_TIME;
entry->ktr_cpu = cpu;
+ if (file != NULL)
+ while (strncmp(file, "../", 3) == 0)
+ file += 3;
entry->ktr_file = file;
entry->ktr_line = line;
#ifdef KTR_VERBOSE
OpenPOWER on IntegriCloud