From d05555e8a26e57cb2494ed5fa68fb5e3df459438 Mon Sep 17 00:00:00 2001 From: kris Date: Thu, 29 Nov 2007 23:11:48 +0000 Subject: [PATCH] don't require a ".nse" extension when specifying script names with --script --- nse_init.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nse_init.cc b/nse_init.cc index 2c5d95ea6..33b8b31e2 100644 --- a/nse_init.cc +++ b/nse_init.cc @@ -227,6 +227,12 @@ int init_rules(lua_State* l, std::vector chosenScripts) { c_iter = strdup((*iter).c_str()); type = init_fetchfile(path, sizeof(path), c_iter); free(c_iter); + + if (type == 0) { + c_iter = strdup((*iter + std::string(SCRIPT_ENGINE_EXTENSION)).c_str()); + type = init_fetchfile(path, sizeof(path), c_iter); + free(c_iter); + } switch(type) { case 0: // no such path