g_concat_dir_and_file does bad thing with "" for dir
- From: Darin Adler <darin eazel com>
- To: Gnome Developers <gnome-devel-list gnome org>
- Cc: Miguel de Icaza <miguel gnu org>, George <jirka 5z com>
- Subject: g_concat_dir_and_file does bad thing with "" for dir
- Date: Thu, 06 Jul 2000 08:31:59 -0700
> 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]