changeset 130:9c10afbb745a

fc-simtool: search added to file-reading commands
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 20 Feb 2021 21:54:12 +0000
parents 94d87d05f6c5
children 7305f2e63d66
files simtool/pbrestore.c simtool/script.c simtool/smsp_restore.c
diffstat 3 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/simtool/pbrestore.c	Sat Feb 20 21:00:24 2021 +0000
+++ b/simtool/pbrestore.c	Sat Feb 20 21:54:12 2021 +0000
@@ -10,6 +10,8 @@
 #include <stdlib.h>
 #include "curfile.h"
 
+extern FILE *open_script_input_file();
+
 extern char *alpha_from_file_qstring();
 extern char *alpha_from_file_hex();
 
@@ -134,7 +136,7 @@
 		perror("malloc for full phonebook EF");
 		return(-1);
 	}
-	inf = fopen(argv[2], "r");
+	inf = open_script_input_file(argv[2]);
 	if (!inf) {
 		perror(argv[2]);
 		free(databuf);
@@ -176,7 +178,7 @@
 	rc = phonebook_op_common(argv[1]);
 	if (rc < 0)
 		return(rc);
-	inf = fopen(argv[2], "r");
+	inf = open_script_input_file(argv[2]);
 	if (!inf) {
 		perror(argv[2]);
 		return(-1);
@@ -218,7 +220,7 @@
 		perror("malloc for full EF_LND");
 		return(-1);
 	}
-	inf = fopen(argv[1], "r");
+	inf = open_script_input_file(argv[1]);
 	if (!inf) {
 		perror(argv[1]);
 		free(databuf);
--- a/simtool/script.c	Sat Feb 20 21:00:24 2021 +0000
+++ b/simtool/script.c	Sat Feb 20 21:54:12 2021 +0000
@@ -7,6 +7,8 @@
 #include <string.h>
 #include <strings.h>
 
+extern FILE *open_script_input_file();
+
 cmd_exec(argc, argv)
 	char **argv;
 {
@@ -14,7 +16,7 @@
 	char linebuf[512], *cp;
 	int lineno, retval = 0;
 
-	f = fopen(argv[1], "r");
+	f = open_script_input_file(argv[1]);
 	if (!f) {
 		perror(argv[1]);
 		return(-1);
--- a/simtool/smsp_restore.c	Sat Feb 20 21:00:24 2021 +0000
+++ b/simtool/smsp_restore.c	Sat Feb 20 21:54:12 2021 +0000
@@ -10,6 +10,8 @@
 #include <stdlib.h>
 #include "curfile.h"
 
+extern FILE *open_script_input_file();
+
 extern char *alpha_from_file_qstring();
 extern char *alpha_from_file_hex();
 
@@ -220,7 +222,7 @@
 	rc = select_ef_smsp();
 	if (rc < 0)
 		return(rc);
-	inf = fopen(argv[1], "r");
+	inf = open_script_input_file(argv[1]);
 	if (!inf) {
 		perror(argv[1]);
 		return(-1);