changeset 227:6616f4e35579

fc-loadtool: exec command now looks for scripts in the current directory
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 03 Aug 2017 01:21:45 +0000
parents e7d5ce499693
children ccf5edab9d5f
files loadtools/ltmain.c loadtools/ltscript.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/loadtools/ltmain.c	Thu Aug 03 00:37:59 2017 +0000
+++ b/loadtools/ltmain.c	Thu Aug 03 01:21:45 2017 +0000
@@ -83,7 +83,7 @@
 		putchar('\n');
 		if (hw_init_script[0]) {
 			printf("Executing init script %s\n", hw_init_script);
-			loadtool_exec_script(hw_init_script);
+			loadtool_exec_script(hw_init_script, 1);
 		}
 	}
 	for (;;) {
--- a/loadtools/ltscript.c	Thu Aug 03 00:37:59 2017 +0000
+++ b/loadtools/ltscript.c	Thu Aug 03 01:21:45 2017 +0000
@@ -11,7 +11,7 @@
 
 extern char default_helpers_dir[];
 
-loadtool_exec_script(script_name)
+loadtool_exec_script(script_name, is_init_script)
 	char *script_name;
 {
 	char pathbuf[MAXPATHLEN], *openfname;
@@ -19,7 +19,7 @@
 	char linebuf[512], *cp;
 	int lineno, retval = 0;
 
-	if (index(script_name, '/'))
+	if (!is_init_script || index(script_name, '/'))
 		openfname = script_name;
 	else {
 		sprintf(pathbuf, "%s/%s", default_helpers_dir, script_name);
@@ -50,5 +50,5 @@
 cmd_exec(argc, argv)
 	char **argv;
 {
-	return loadtool_exec_script(argv[1]);
+	return loadtool_exec_script(argv[1], 0);
 }