Provide helper wrappers for basename(3) and dirname(3)

This hides the need to provide mutable C strings, and unifies
existing basename calls and variations in a single location.

Change-Id: Idfb449c47b1421f1a751efc3d7404f15f8b369ca
Reviewed-on: https://chromium-review.googlesource.com/725731
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
Tobias Sargeant 2017-10-18 16:39:09 +01:00 committed by Tobias Sargeant
parent 9b23ca3a7c
commit 072f86ca83
10 changed files with 220 additions and 31 deletions

View file

@ -38,6 +38,7 @@
#include <string>
#include <vector>
#include "common/path_helper.h"
#include "common/scoped_ptr.h"
#include "common/using_std_string.h"
#include "google_breakpad/processor/basic_source_line_resolver.h"
@ -130,7 +131,7 @@ static void Usage(int argc, const char *argv[], bool error) {
"\n"
" -m Output in machine-readable format\n"
" -s Output stack contents\n",
basename(argv[0]));
google_breakpad::BaseName(argv[0]).c_str());
}
static void SetupOptions(int argc, const char *argv[], Options* options) {