From 47d4e9509a8ffde1cab4a6f8d2be4ce232ba1cfb Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Mon, 9 Apr 2012 12:24:49 -0300 Subject: Compare filenames using g_file_equal() Makes it work on case-sensitive file systems such as HFS+. https://bugzilla.gnome.org/show_bug.cgi?id=667405 --- giscanner/giscannermodule.c | 4 ++++ giscanner/sourcescanner.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'giscanner') diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c index 81adbd8c..0da20f18 100644 --- a/giscanner/giscannermodule.c +++ b/giscanner/giscannermodule.c @@ -38,6 +38,8 @@ #include #endif +#include + DL_EXPORT(void) init_giscanner(void); #define NEW_CLASS(ctype, name, cname) \ @@ -720,6 +722,8 @@ init_giscanner(void) PyObject *m, *d; gboolean is_uninstalled; + g_type_init (); + /* Hack to avoid having to create a fake directory structure; when * running uninstalled, the module will be in the top builddir, * with no _giscanner prefix. diff --git a/giscanner/sourcescanner.c b/giscanner/sourcescanner.c index 1ae14bc3..1b775b46 100644 --- a/giscanner/sourcescanner.c +++ b/giscanner/sourcescanner.c @@ -22,6 +22,7 @@ #include "sourcescanner.h" #include +#include GISourceSymbol * gi_source_symbol_new (GISourceSymbolType type, const gchar *filename, int line) @@ -242,15 +243,22 @@ gi_source_scanner_add_symbol (GISourceScanner *scanner, { gboolean found_filename = FALSE; GList *l; + GFile *current_file; g_assert (scanner->current_filename); + current_file = g_file_new_for_path (scanner->current_filename); + for (l = scanner->filenames; l != NULL; l = l->next) { - if (strcmp (l->data, scanner->current_filename) == 0) + GFile *file = g_file_new_for_path (l->data); + + if (g_file_equal (file, current_file)) { found_filename = TRUE; + g_object_unref (file); break; } + g_object_unref (file); } if (found_filename || scanner->macro_scan) @@ -275,6 +283,8 @@ gi_source_scanner_add_symbol (GISourceScanner *scanner, default: break; } + + g_object_unref (current_file); } GSList * -- cgit v1.2.1