[Geany-devel] regular|symlink file tests

Frank Lanitz frank at xxxxx
Sun Jul 4 09:09:28 UTC 2010


On Sat, 26 Jun 2010 16:03:44 +0300
Dimitar Zhekov <dimitar.zhekov at 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
-- 
Frank Lanitz <frank at frank.uvena.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100704/3b716bb7/attachment.pgp>


More information about the Devel mailing list