;
}
+// Return whether `path` is a full path.
+inline bool
+is_full_path(nonstd::string_view path)
+{
+#ifdef _WIN32
+ if (path.find('\\') != nonstd::string_view::npos) {
+ return true;
+ }
+#endif
+ return path.find('/') != nonstd::string_view::npos;
+}
+
// Return whether `path` represents a precompiled header (see "Precompiled
// Headers" in GCC docs).
bool is_precompiled_header(nonstd::string_view path);
std::string base(Util::base_name(argv[0]));
if (Util::same_program_name(base, MYNAME)) {
ctx.orig_args.pop_front();
- if (is_full_path(ctx.orig_args[0].c_str())) {
- // A full path was given.
+ if (Util::is_full_path(ctx.orig_args[0])) {
return;
}
base = std::string(Util::base_name(ctx.orig_args[0]));
# include <sys/time.h>
#endif
-// Return whether the argument is a full path.
-bool
-is_full_path(const char* path)
-{
-#ifdef _WIN32
- if (strchr(path, '\\')) {
- return true;
- }
-#endif
- return strchr(path, '/');
-}
-
// Update the modification time of a file in the cache to save it from LRU
// cleanup.
void
#include <string>
-bool is_full_path(const char* path);
void update_mtime(const char* path);
void x_exit(int status) ATTR_NORETURN;
int x_rename(const char* oldpath, const char* newpath);