comparison host/tools/ecostest/common/eCosTestPlatform.cpp @ 2921:54e4112a7eef

* common/eCosTestPlatform.cpp (CeCosTestPlatform::LoadFromDir): Use PATH_MAX to accommodate long directory names. Issue reported by Paul Chavent.
author jld
date Fri, 25 Sep 2009 07:55:36 +0000
parents 74dbf4c3f2e1
children c40674be6da8
comparison
equal deleted inserted replaced
2920:ca9867bef994 2921:54e4112a7eef
1 // ####ECOSHOSTGPLCOPYRIGHTBEGIN#### 1 // ####ECOSHOSTGPLCOPYRIGHTBEGIN####
2 // ------------------------------------------- 2 // -------------------------------------------
3 // This file is part of the eCos host tools. 3 // This file is part of the eCos host tools.
4 // Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 4 // Copyright (C) 1998, 1999, 2000, 2003, 2009 Free Software Foundation, Inc.
5 // 5 //
6 // This program is free software; you can redistribute it and/or modify 6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by 7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 or (at your option) any 8 // the Free Software Foundation; either version 2 or (at your option) any
9 // later version. 9 // later version.
56 bool CeCosTestPlatform::LoadFromDir(LPCTSTR pszDir) 56 bool CeCosTestPlatform::LoadFromDir(LPCTSTR pszDir)
57 { 57 {
58 bool rc=true; 58 bool rc=true;
59 TRACE(_T("CeCosTestPlatform::LoadFromDir %s\n"),pszDir); 59 TRACE(_T("CeCosTestPlatform::LoadFromDir %s\n"),pszDir);
60 // Find all the files in directory pszDir and load from each of them 60 // Find all the files in directory pszDir and load from each of them
61 TCHAR szOrigDir[256]; 61 TCHAR szOrigDir[PATH_MAX];
62 _tgetcwd(szOrigDir,sizeof szOrigDir-1); 62 _tgetcwd(szOrigDir,sizeof szOrigDir-1);
63 if(0==_tchdir(pszDir)){ 63 if(0==_tchdir(pszDir)){
64 String strFile; 64 String strFile;
65 void *pHandle; 65 void *pHandle;
66 for(bool b=CeCosTestUtils::StartSearch(pHandle,strFile);b;b=CeCosTestUtils::NextFile(pHandle,strFile)){ 66 for(bool b=CeCosTestUtils::StartSearch(pHandle,strFile);b;b=CeCosTestUtils::NextFile(pHandle,strFile)){