From 320cb2f961877cafd3b63c8715836dbf87d96b7d Mon Sep 17 00:00:00 2001 From: Matteo Paonessa Date: Mon, 20 Mar 2017 00:51:47 +0100 Subject: [PATCH] str_replace is _WIN32 only --- src/utils.c | 4 ++-- src/utils.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/utils.c b/src/utils.c index 8fbed3b..9913ef0 100644 --- a/src/utils.c +++ b/src/utils.c @@ -91,7 +91,7 @@ int mkpath(const char *pathname) return -1; } /* make this one if parent has been made */ - if (mkdir(pathname) == 0) { + if (mkdir(pathname, 0777) == 0) { return 0; } /* if it already exists that is fine */ @@ -158,6 +158,7 @@ char *get_human_size(off_t size) return final; } +#ifdef _WIN32 char *str_replace(char *orig, char *rep, char *with) { char *result; // the return string char *ins; // the next insert point @@ -197,7 +198,6 @@ char *str_replace(char *orig, char *rep, char *with) { return result; } -#ifdef _WIN32 char *strsep (char **stringp, const char *delim) { char *begin, *end; diff --git a/src/utils.h b/src/utils.h index 46bb5e5..9942b8d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -21,9 +21,8 @@ char* get_human_size(off_t size); int mkpath(const char *pathname); -char *str_replace(char *orig, char *rep, char *with); - #ifdef _WIN32 +char *str_replace(char *orig, char *rep, char *with); char *strsep(char **stringp, const char *delim); #endif