g_concat_dir_and_file does bad thing with "" for dir

> if (dir [strlen(dir) - 1] != PATH_SEP)

The above code won't work right if the dir is "".

We can either add:

    g_return_val_if_fail (dir [0] != '\0', NULL);

Or change the if to:

    if (dir [0] != '\0' && dir [strlen(dir) - 1] != PATH_SEP)

Depending on whether we want a directory of "" to be an error or not. I'll
make the change, I just need an OK from a maintainer I guess.

(I noticed this because I am wanting to delete nautilus_make_path, which is
the same function, without this particular mistake.)

    -- Darin

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]