Changeset b249516 in rtems-tools for rtemstoolkit
- Timestamp:
- Mar 29, 2015, 7:06:00 AM (5 years ago)
- Branches:
- 4.10, 4.11, master
- Children:
- e98d5fa
- Parents:
- 5032d71
- Location:
- rtemstoolkit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
rtemstoolkit/rld-path.cpp
r5032d71 rb249516 215 215 } 216 216 } 217 218 void 219 get_system_path (paths& paths) 220 { 221 const char* path = ::getenv ("PATH"); 222 strings ps; 223 rld::split (ps, path, RLD_PATHSTR_SEPARATOR); 224 if (ps.size ()) 225 { 226 for (strings::iterator psi = ps.begin (); 227 psi != ps.end (); 228 ++psi) 229 { 230 if (check_directory (*psi)) 231 paths.push_back (*psi); 232 } 233 } 234 } 217 235 } 218 236 } -
rtemstoolkit/rld-path.h
r5032d71 rb249516 145 145 void unlink (const std::string& path, bool not_present_error = false); 146 146 147 /** 148 * Return the system path as a set of strings. 149 * 150 * @param paths The split path paths. 151 */ 152 void get_system_path (paths& paths); 147 153 } 148 154 } -
rtemstoolkit/rld.cpp
r5032d71 rb249516 236 236 set_progname (const std::string& progname_) 237 237 { 238 progname = rld::path::path_abs (progname_); 238 if (rld::path::check_file (progname_)) 239 progname = rld::path::path_abs (progname_); 240 else 241 { 242 rld::path::paths paths; 243 rld::path::get_system_path (paths); 244 for (rld::path::paths::const_iterator path = paths.begin (); 245 path != paths.end (); 246 ++path) 247 { 248 std::string pp; 249 rld::path::path_join (*path, progname_, pp); 250 if (rld::path::check_file (pp)) 251 { 252 progname = rld::path::path_abs (pp); 253 break; 254 } 255 } 256 } 239 257 } 240 258 … … 263 281 if (rld::path::basename (pp) == "bin") 264 282 return rld::path::dirname (pp); 265 return "";283 return pp; 266 284 } 267 285
Note: See TracChangeset
for help on using the changeset viewer.