[Geany-devel] regular|symlink file tests

Dimitar Zhekov dimitar.zhekov at xxxxx
Sat Jun 26 13:03:44 UTC 2010


Hi,

In geany, there are a few checks of the type:

g_file_test(<filename>, G_FILE_TEST_IS_REGULAR |
G_FILE_TEST_IS_SYMLINK)

which presumably check if <filename> is a regular file, or a symlink to
one. However, G_FILE_TEST_IS_REGULAR follows symlinks and is
enough for the test, while G_FILE_TEST_IS_SYMLINK (and consequently
G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK) is true for any type
of symlink, including broken and link to directory.

I think G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK should be
replaced with G_FILE_TEST_IS_REGULAR.

-- 
E-gards: Jimmy



More information about the Devel mailing list