aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/breakpad/breakpad/0005-md2core-Replace-basename.patch
blob: 852c1ed2ca7a86d8fd0f28ac19c4250baa782fc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From bbf2b5ed5d93b227df8aea5726727b48e29f6790 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 14 Sep 2017 23:35:40 -0700
Subject: [PATCH 5/5] md2core: Replace basename()

musl does not provide it

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/tools/linux/md2core/minidump-2-core.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc
index 6a9e28eb..52b81c22 100644
--- a/src/tools/linux/md2core/minidump-2-core.cc
+++ b/src/tools/linux/md2core/minidump-2-core.cc
@@ -107,6 +107,9 @@ struct Options {
 
 static void
 Usage(int argc, const char* argv[]) {
+  const char *c_filename = argv[0];;
+  const char *p = strrchr(c_filename, '/');
+  const char *base = p ? p+1 : c_filename;
   fprintf(stderr,
           "Usage: %s [options] <minidump file>\n"
           "\n"
@@ -133,7 +136,7 @@ Usage(int argc, const char* argv[]) {
           "             lookups to be done in this directory rather than the filesystem\n"
           "             layout as it exists in the crashing image.  This path should end\n"
           "             with a slash if it's a directory.  e.g. /var/lib/breakpad/\n"
-          "", basename(argv[0]));
+          "", base);
 }
 
 static void
-- 
2.14.1