- string file_string_o = path_->find (*file_string);
- if ((file_string_o == "") && (*file_string != ""))
- return 0;
- *file_string = file_string_o;
+ // First, check for a path relative to the directory of the
+ // file currently being parsed.
+ if (current_dir.length ()
+ && file_string.length ()
+ && !File_name (file_string).is_absolute ()
+ && is_file (current_dir + DIRSEP + file_string))
+ file_string = current_dir + DIRSEP + file_string;
+
+ // Otherwise, check the rest of the path.
+ else if (path_)
+ {
+ string file_string_o = path_->find (file_string);
+ if ((file_string_o == "") && (file_string != ""))
+ return 0;
+
+ file_string = file_string_o;
+ }