Ticket #6427: add-ons-relative-path.patch
File add-ons-relative-path.patch, 1.2 KB (added by , 13 years ago) |
---|
-
runtime_loader.cpp
224 224 if (strchr(name, '/')) { 225 225 // the name already contains a path, we don't have to search for it 226 226 fd = _kern_open(-1, name, O_RDONLY, 0); 227 if (fd >= 0 || type != B_LIBRARY_IMAGE)227 if (fd >= 0 || type == B_APP_IMAGE) 228 228 return fd; 229 229 230 // can't search harder an absolute path add-on name! 231 if (type == B_ADD_ON_IMAGE && name[0] == '/') 232 return fd; 233 230 234 // Even though ELF specs don't say this, we give shared libraries 231 // another chance and look them up in the usual search paths - at 235 // and relative path based add-ons another chance and look 236 // them up in the usual search paths - at 232 237 // least that seems to be what BeOS does, and since it doesn't hurt... 233 paths = strrchr(name, '/') + 1; 234 memmove(name, paths, strlen(paths) + 1); 238 if (type == B_LIBRARY_IMAGE) { 239 // For library (but not add-on), strip any path from name 240 // Relative path of add-on is kept 241 paths = strrchr(name, '/') + 1; 242 memmove(name, paths, strlen(paths) + 1); 243 } 235 244 } 236 245 237 246 // let's evaluate the system path variables to find the container