mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-13 20:47:46 +02:00
make g_file_test(,G_FILE_TEST_IS_EXECUTABLE) return something useful on
2003-12-14 Hans Breuer <hans@breuer.org> * glib/gfileutils.c : make g_file_test(,G_FILE_TEST_IS_EXECUTABLE) return something useful on win32, too.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2003-12-14 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c : make g_file_test(,G_FILE_TEST_IS_EXECUTABLE)
|
||||||
|
return something useful on win32, too.
|
||||||
|
|
||||||
2003-12-13 Hans Breuer <hans@breuer.org>
|
2003-12-13 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/gconvert.c : get_filename_charset() needs to
|
* glib/gconvert.c : get_filename_charset() needs to
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
2003-12-14 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c : make g_file_test(,G_FILE_TEST_IS_EXECUTABLE)
|
||||||
|
return something useful on win32, too.
|
||||||
|
|
||||||
2003-12-13 Hans Breuer <hans@breuer.org>
|
2003-12-13 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/gconvert.c : get_filename_charset() needs to
|
* glib/gconvert.c : get_filename_charset() needs to
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
2003-12-14 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c : make g_file_test(,G_FILE_TEST_IS_EXECUTABLE)
|
||||||
|
return something useful on win32, too.
|
||||||
|
|
||||||
2003-12-13 Hans Breuer <hans@breuer.org>
|
2003-12-13 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/gconvert.c : get_filename_charset() needs to
|
* glib/gconvert.c : get_filename_charset() needs to
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
2003-12-14 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c : make g_file_test(,G_FILE_TEST_IS_EXECUTABLE)
|
||||||
|
return something useful on win32, too.
|
||||||
|
|
||||||
2003-12-13 Hans Breuer <hans@breuer.org>
|
2003-12-13 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/gconvert.c : get_filename_charset() needs to
|
* glib/gconvert.c : get_filename_charset() needs to
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
2003-12-14 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c : make g_file_test(,G_FILE_TEST_IS_EXECUTABLE)
|
||||||
|
return something useful on win32, too.
|
||||||
|
|
||||||
2003-12-13 Hans Breuer <hans@breuer.org>
|
2003-12-13 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/gconvert.c : get_filename_charset() needs to
|
* glib/gconvert.c : get_filename_charset() needs to
|
||||||
|
@@ -1,3 +1,8 @@
|
|||||||
|
2003-12-14 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c : make g_file_test(,G_FILE_TEST_IS_EXECUTABLE)
|
||||||
|
return something useful on win32, too.
|
||||||
|
|
||||||
2003-12-13 Hans Breuer <hans@breuer.org>
|
2003-12-13 Hans Breuer <hans@breuer.org>
|
||||||
|
|
||||||
* glib/gconvert.c : get_filename_charset() needs to
|
* glib/gconvert.c : get_filename_charset() needs to
|
||||||
|
@@ -40,7 +40,6 @@
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
#ifndef F_OK
|
#ifndef F_OK
|
||||||
#define F_OK 0
|
#define F_OK 0
|
||||||
#define X_OK 1
|
|
||||||
#define W_OK 2
|
#define W_OK 2
|
||||||
#define R_OK 4
|
#define R_OK 4
|
||||||
#endif /* !F_OK */
|
#endif /* !F_OK */
|
||||||
@@ -121,11 +120,10 @@ g_file_test (const gchar *filename,
|
|||||||
if ((test & G_FILE_TEST_EXISTS) && (access (filename, F_OK) == 0))
|
if ((test & G_FILE_TEST_EXISTS) && (access (filename, F_OK) == 0))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
#ifndef G_OS_WIN32
|
||||||
if ((test & G_FILE_TEST_IS_EXECUTABLE) && (access (filename, X_OK) == 0))
|
if ((test & G_FILE_TEST_IS_EXECUTABLE) && (access (filename, X_OK) == 0))
|
||||||
{
|
{
|
||||||
#ifndef G_OS_WIN32
|
|
||||||
if (getuid () != 0)
|
if (getuid () != 0)
|
||||||
#endif
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* For root, on some POSIX systems, access (filename, X_OK)
|
/* For root, on some POSIX systems, access (filename, X_OK)
|
||||||
@@ -135,6 +133,7 @@ g_file_test (const gchar *filename,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
test &= ~G_FILE_TEST_IS_EXECUTABLE;
|
test &= ~G_FILE_TEST_IS_EXECUTABLE;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (test & G_FILE_TEST_IS_SYMLINK)
|
if (test & G_FILE_TEST_IS_SYMLINK)
|
||||||
{
|
{
|
||||||
@@ -171,6 +170,10 @@ g_file_test (const gchar *filename,
|
|||||||
(s.st_mode & S_IXUSR) ||
|
(s.st_mode & S_IXUSR) ||
|
||||||
(s.st_mode & S_IXGRP)))
|
(s.st_mode & S_IXGRP)))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
#else
|
||||||
|
if ((test & G_FILE_TEST_IS_EXECUTABLE) &&
|
||||||
|
(s.st_mode & _S_IEXEC))
|
||||||
|
return TRUE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user