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.
On Sat, 26 Jun 2010 16:03:44 +0300 Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
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.
Yes indeed. The or doesn't seem to make big sense here.
Cheers, Frank
On Sun, 4 Jul 2010 11:09:28 +0200 Frank Lanitz frank@frank.uvena.de wrote:
I think G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK should be replaced with G_FILE_TEST_IS_REGULAR.
Yes indeed. The or doesn't seem to make big sense here.
Here is a patch then.
On Sun, 4 Jul 2010 15:26:09 +0300 Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
On Sun, 4 Jul 2010 11:09:28 +0200 Frank Lanitz frank@frank.uvena.de wrote:
I think G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK should be replaced with G_FILE_TEST_IS_REGULAR.
Yes indeed. The or doesn't seem to make big sense here.
Here is a patch then.
Applied, thanks.
Regards, Nick