summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2002-12-11 23:40:10 +0000
committerTor Lillqvist <tml@src.gnome.org>2002-12-11 23:40:10 +0000
commit12bc3d826c37d5eb675e1875a1726aa776bcafa0 (patch)
treef2fe697f5d13e7d78c3e7d11554d8f1217db91a1 /glib
parentd0579998b20a9932260a79969b01dbfe958da0ee (diff)
downloadglib-12bc3d826c37d5eb675e1875a1726aa776bcafa0.tar.gz
Fix off-by-one error. (#100853)
2002-12-11 Tor Lillqvist <tml@iki.fi> * glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853) * glib/gfileutils.c (g_file_test): Bypass extra test for root on Win32. * glib/glib.def: Add g_{get,set}_application_name.
Diffstat (limited to 'glib')
-rw-r--r--glib/gfileutils.c4
-rw-r--r--glib/glib.def2
-rw-r--r--glib/gtimer.c4
3 files changed, 7 insertions, 3 deletions
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
index c67d5b5ef..295a1dfee 100644
--- a/glib/gfileutils.c
+++ b/glib/gfileutils.c
@@ -156,14 +156,16 @@ g_file_test (const gchar *filename,
if ((test & G_FILE_TEST_IS_DIR) && S_ISDIR (s.st_mode))
return TRUE;
+#ifndef G_OS_WIN32
/* The extra test for root when access (file, X_OK) succeeds.
+ * Probably only makes sense on Unix.
*/
if ((test & G_FILE_TEST_IS_EXECUTABLE) &&
((s.st_mode & S_IXOTH) ||
(s.st_mode & S_IXUSR) ||
(s.st_mode & S_IXGRP)))
return TRUE;
-
+#endif
}
}
diff --git a/glib/glib.def b/glib/glib.def
index 4ab5676ae..9af5b399f 100644
--- a/glib/glib.def
+++ b/glib/glib.def
@@ -165,6 +165,7 @@ EXPORTS
g_find_program_in_path
g_fprintf
g_free
+ g_get_application_name
g_get_charset
g_get_codeset
g_get_current_dir
@@ -480,6 +481,7 @@ EXPORTS
g_scanner_sync_file_offset
g_scanner_unexp_token
g_scanner_warn
+ g_set_application_name
g_set_error
g_set_prgname
g_set_print_handler
diff --git a/glib/gtimer.c b/glib/gtimer.c
index 2e3e3c878..cdfbb19b3 100644
--- a/glib/gtimer.c
+++ b/glib/gtimer.c
@@ -135,7 +135,7 @@ g_timer_elapsed (GTimer *timer,
/* Check for wraparound, which happens every 49.7 days. */
if (timer->end < timer->start)
- total = (UINT_MAX - (timer->start - timer->end)) / 1000.0;
+ total = (UINT_MAX - (timer->start - timer->end - 1)) / 1000.0;
else
total = (timer->end - timer->start) / 1000.0;
@@ -143,7 +143,7 @@ g_timer_elapsed (GTimer *timer,
{
if (timer->end < timer->start)
*microseconds =
- ((UINT_MAX - (timer->start - timer->end)) % 1000) * 1000;
+ ((UINT_MAX - (timer->start - timer->end - 1)) % 1000) * 1000;
else
*microseconds =
((timer->end - timer->start) % 1000) * 1000;