From 2e96f68445fc079b142dca7964c831bbe778181b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 25 Nov 2000 20:54:24 +0000 Subject: [PATCH] mkpath() crashed with paths that didn't start with / git-svn-id: http://svn.irssi.org/repos/irssi/trunk@867 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/misc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/misc.c b/src/core/misc.c index d57c4881..9115f29a 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -394,6 +394,11 @@ int mkpath(const char *path, int mode) g_return_val_if_fail(path != NULL, -1); p = g_path_skip_root((char *) path); + if (p == NULL) { + /* not a full path, maybe not what we wanted + but continue anyway.. */ + p = path; + } for (;;) { if (*p != G_DIR_SEPARATOR && *p != '\0') { p++;