[nemiver] Lookup files in the inferior's directory



commit 96aa34459062d9b18fe70c530fdf365e10f40e72
Author: Dodji Seketeli <dodji gnome org>
Date:   Sat Aug 7 15:39:23 2010 +0200

    Lookup files in the inferior's directory
    
    	* src/persp/dbgperspective/nmv-dbg-perspective.cc:
    	(DBGPerspective::find_file_in_source_dirs): Lookup files in the
    	directory of the binary too.

 src/persp/dbgperspective/nmv-dbg-perspective.cc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index 42eb6d6..1afaaf7 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -4855,6 +4855,14 @@ DBGPerspective::find_file_in_source_dirs (const UString &a_file_name,
         a_file_path = Glib::filename_to_utf8 (candidate);
         return true;
     }
+    // then look in the directory of the binary
+    candidate =
+        Glib::build_filename (Glib::path_get_dirname (m_priv->prog_path),
+                              file_name);
+    if (Glib::file_test (candidate, Glib::FILE_TEST_IS_REGULAR)) {
+        a_file_path = Glib::filename_to_utf8 (candidate);
+        return true;
+    }
     // then look in the session-specific search paths
     list<UString>::const_iterator session_iter;
     for (session_iter = m_priv->search_paths.begin ();



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