mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 03:36:21 +00:00
Moved directory creating functions to common.h
Removed duplicate function
This commit is contained in:
13
src/common.c
13
src/common.c
@@ -79,6 +79,19 @@ create_dir(char *name)
|
||||
e = mkdir(name, S_IRWXU);
|
||||
}
|
||||
|
||||
void
|
||||
mkdir_recursive(const char *dir)
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i <= strlen(dir); i++) {
|
||||
if (dir[i] == '/' || dir[i] == '\0') {
|
||||
gchar *next_dir = g_strndup(dir, i);
|
||||
create_dir(next_dir);
|
||||
g_free(next_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
str_replace(const char *string, const char *substr,
|
||||
const char *replacement)
|
||||
|
||||
Reference in New Issue
Block a user