This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Configtool to ignore "." in PATH when looking for tools


Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/ChangeLog,v
retrieving revision 1.55
diff -u -5 -r1.55 ChangeLog
--- ChangeLog	1 May 2003 12:00:51 -0000	1.55
+++ ChangeLog	2 May 2003 13:56:10 -0000
@@ -1,5 +1,10 @@
+2003-05-02  John Dallaway  <jld@ecoscentric.com>
+
+	* standalone/wxwin/appsettings.cpp: Don't use "." in the PATH to
+	look for build tools and user tools.
+
 2003-05-01  John Dallaway  <jld@ecoscentric.com>
 
 	* standalone/common/cdl_exec.cxx: Generate Cygwin text-mode mounts
 	explicitly since text-mode is no longer the default.

Index: standalone/wxwin/appsettings.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/appsettings.cpp,v
retrieving revision 1.13
diff -u -5 -r1.13 appsettings.cpp
--- standalone/wxwin/appsettings.cpp	17 Apr 2003 14:18:40 -0000	1.13
+++ standalone/wxwin/appsettings.cpp	2 May 2003 13:56:10 -0000
@@ -410,26 +410,29 @@
         {
 	    wxString gccExe(wxT("*-gcc"));
 
 	    wxArrayString arstrPath;
             ecUtils::Chop(strPath, arstrPath, wxT(':'));
-
+
             for (int i = arstrPath.GetCount()-1;i >= 0; --i)
             { // Reverse order is important to treat path correctly
-                wxLogNull log;
-                wxDir finder(arstrPath[i]);
-                wxString filename;
-            
-                if (finder.IsOpened())
+                if (wxT(".") != arstrPath[i] && !arstrPath[i].IsEmpty())
                 {
-                    bool bMore = finder.GetFirst(& filename, gccExe);
-                    while (bMore)
+                    wxLogNull log;
+                    wxDir finder(arstrPath[i]);
+                    wxString filename;
+
+                    if (finder.IsOpened())
                     {
-                        wxString targetName = filename.Left(filename.Find(wxT("-gcc")));
-                        m_arstrBinDirs.Set(targetName, arstrPath[i]);
-                    
-                        bMore = finder.GetNext(& filename);
+                        bool bMore = finder.GetFirst(& filename, gccExe);
+                        while (bMore)
+                        {
+                            wxString targetName = filename.Left(filename.Find(wxT("-gcc")));
+                            m_arstrBinDirs.Set(targetName, arstrPath[i]);
+
+                            bMore = finder.GetNext(& filename);
+                        }
                     }
                 }
             }
         }
     }
@@ -455,11 +458,11 @@
     }

     // Read toolchain paths (local machine again)
 #ifdef __WXMSW__
     wxArrayString arstrToolChainPaths;
-
+
     // Use eCos just as a test.
     //GetRepositoryRegistryClues(arstrToolChainPaths,_T("eCos"));
     GetRepositoryRegistryClues(arstrToolChainPaths,_T("GNUPro eCos"));
     
     size_t i;
@@ -544,35 +547,38 @@
             wxArrayString arstrPath;
             ecUtils::Chop(strPath, arstrPath, wxT(';'));

             for (int i = arstrPath.GetCount()-1;i >= 0; --i)
             { // Reverse order is important to treat path correctly
-                
+
                 const ecFileName &strFolder = arstrPath[i];
-                ecFileName strFile(strFolder);
-                strFile += wxT("ls.exe");
-                if ( strFile.Exists() )
+                if (wxT(".") != strFolder && !strFolder.IsEmpty())
                 {
-                    if (!wxArrayStringIsMember(m_userToolPaths, strFolder))
-                    {
-                        m_userToolPaths.Add(strFolder);
-                    }
-                    
-                    if ( m_userToolsDir.IsEmpty() )
+                    ecFileName strFile(strFolder);
+                    strFile += wxT("ls.exe");
+                    if ( strFile.Exists() )
                     {
-                        m_userToolsDir = strFolder;
+                        if (!wxArrayStringIsMember(m_userToolPaths, strFolder))
+                        {
+                            m_userToolPaths.Add(strFolder);
+                        }
+
+                        if ( m_userToolsDir.IsEmpty() )
+                        {
+                            m_userToolsDir = strFolder;
+                        }
                     }
                 }
             }
         }
     }

     // Load current repository from eCos Configuration Tool/Paths/RepositoryDir
     {
         wxConfig eCosConfig(wxGetApp().GetSettings().GetConfigAppName(), wxEmptyString, wxEmptyString, wxEmptyString, wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_LOCAL_FILE);
         wxConfigPathChanger path(& config, wxT("/Repository/"));
-        
+
         //if (!eCosConfig.Read(wxT("Folder"), & m_strRepository))
         if (!eCosConfig.Read(wxT("/Paths/RepositoryDir"), & m_strRepository))
         {
 #ifdef __WXMSW__
             // If we can't find the current folder, look for clues in the registry.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]