mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 16:12:30 +02:00
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
This commit is contained in:
parent
45c9838141
commit
2e96f68445
1 changed files with 5 additions and 0 deletions
|
|
@ -394,6 +394,11 @@ int mkpath(const char *path, int mode)
|
||||||
g_return_val_if_fail(path != NULL, -1);
|
g_return_val_if_fail(path != NULL, -1);
|
||||||
|
|
||||||
p = g_path_skip_root((char *) path);
|
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 (;;) {
|
for (;;) {
|
||||||
if (*p != G_DIR_SEPARATOR && *p != '\0') {
|
if (*p != G_DIR_SEPARATOR && *p != '\0') {
|
||||||
p++;
|
p++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue