[gobject-introspection] scanner: Consistently use realpath() on input filenames



commit cf55433f17957c13fc4a345d52d708400215e192
Author: Colin Walters <walters verbum org>
Date:   Thu Jul 25 13:02:59 2013 +0100

    scanner: Consistently use realpath() on input filenames
    
    The scanner has some logic to compare the filenames specified
    on the command line against files it will parse.  For the latter,
    it uses g_realpath().  With this patch, we also use g_realpath()
    on the command line arguments.
    
    This fixes g-i when used inside jhbuild in a gnome-ostree VM,
    which has a symbolic link /home -> /sysroot/home.  This caused
    a realpath mismatch, and then we'd ignore the input source files.
    
    It'd be best to get out of the realpath business entirely...but
    a patch to do that seems more likely to break.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704864

 giscanner/giscannermodule.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c
index a5686ea..182d843 100644
--- a/giscanner/giscannermodule.c
+++ b/giscanner/giscannermodule.c
@@ -515,7 +515,7 @@ pygi_source_scanner_lex_filename (PyGISourceScanner *self,
   if (!PyArg_ParseTuple (args, "s:SourceScanner.lex_filename", &filename))
     return NULL;
 
-  self->scanner->current_filename = g_strdup (filename);
+  self->scanner->current_filename = g_realpath (filename);
   if (!gi_source_scanner_lex_filename (self->scanner, filename))
     {
       g_print ("Something went wrong during lexing.\n");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]