gnome-keyring r1572 - in trunk: . gcr/tests
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-keyring r1572 - in trunk: . gcr/tests
- Date: Sat, 14 Feb 2009 00:23:14 +0000 (UTC)
Author: nnielsen
Date: Sat Feb 14 00:23:14 2009
New Revision: 1572
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1572&view=rev
Log:
Change to right directory so we can easily find test certificates.
Modified:
trunk/ChangeLog
trunk/gcr/tests/ui-test-details.c
Modified: trunk/gcr/tests/ui-test-details.c
==============================================================================
--- trunk/gcr/tests/ui-test-details.c (original)
+++ trunk/gcr/tests/ui-test-details.c Sat Feb 14 00:23:14 2009
@@ -6,6 +6,31 @@
#include <gtk/gtk.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+
+static void
+chdir_base_dir (char* argv0)
+{
+ gchar *dir, *base;
+
+ dir = g_path_get_dirname (argv0);
+ if (chdir (dir) < 0)
+ g_warning ("couldn't change directory to: %s: %s",
+ dir, g_strerror (errno));
+
+ base = g_path_get_basename (dir);
+ if (strcmp (base, ".libs") == 0) {
+ if (chdir ("..") < 0)
+ g_warning ("couldn't change directory to ..: %s",
+ g_strerror (errno));
+ }
+
+ g_free (base);
+ g_free (dir);
+}
+
static void
test_details (void)
{
@@ -40,6 +65,7 @@
int
main(int argc, char *argv[])
{
+ chdir_base_dir (argv[0]);
gtk_init (&argc, &argv);
test_details ();
return 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]