Fix accidental overwrite of BROPATH copy.

This commit is contained in:
Jon Siwek 2011-07-14 18:17:30 -05:00
parent e5e3bf28ec
commit e39a49833f

View file

@ -893,13 +893,14 @@ FILE* search_for_file(const char* filename, const char* ext,
} }
char path[1024], full_filename_buf[1024]; char path[1024], full_filename_buf[1024];
safe_strncpy(path, bro_path(), sizeof(path));
// append the currently loading script's path to BROPATH so that // append the currently loading script's path to BROPATH so that
// @loads can be referenced relatively // @loads can be referenced relatively
if ( current_scanned_file_path != "" ) if ( current_scanned_file_path != "" )
safe_snprintf(path, sizeof(path), "%s:%s", path, safe_snprintf(path, sizeof(path), "%s:%s", bro_path(),
current_scanned_file_path.c_str()); current_scanned_file_path.c_str());
else
safe_strncpy(path, bro_path(), sizeof(path));
char* dir_beginning = path; char* dir_beginning = path;
char* dir_ending = path; char* dir_ending = path;