comparison src/octave.cc @ 1572:0d9e10d10bd7

[project @ 1995-10-19 04:31:30 by jwe]
author jwe
date Thu, 19 Oct 1995 04:31:30 +0000
parents 14d8c0a838c1
children 27f5ac98fc4a
comparison
equal deleted inserted replaced
1571:6ddabf91bc4e 1572:0d9e10d10bd7
56 #include "error.h" 56 #include "error.h"
57 #include "file-io.h" 57 #include "file-io.h"
58 #include "help.h" 58 #include "help.h"
59 #include "input.h" 59 #include "input.h"
60 #include "lex.h" 60 #include "lex.h"
61 #include "oct-str.h"
62 #include "octave-hist.h" 61 #include "octave-hist.h"
63 #include "octave.h" 62 #include "octave.h"
64 #include "pager.h" 63 #include "pager.h"
65 #include "parse.h" 64 #include "parse.h"
66 #include "pathsearch.h" 65 #include "pathsearch.h"
131 130
132 // Nonzero means input is coming from startup file. 131 // Nonzero means input is coming from startup file.
133 int input_from_startup_file = 0; 132 int input_from_startup_file = 0;
134 133
135 // The command-line options. 134 // The command-line options.
136 Octave_str_obj octave_argv; 135 charMatrix octave_argv;
137 136
138 // Nonzero means that input is coming from a file that was named on 137 // Nonzero means that input is coming from a file that was named on
139 // the command line. 138 // the command line.
140 int input_from_command_line_file = 1; 139 int input_from_command_line_file = 1;
141 140
209 static void 208 static void
210 intern_argv (int argc, char **argv) 209 intern_argv (int argc, char **argv)
211 { 210 {
212 if (argc > 1) 211 if (argc > 1)
213 { 212 {
214 octave_argv.resize (argc-1); 213 int max_len = 0;
215 for (int i = 1; i < argc; i++) 214 for (int i = 1; i < argc; i++)
216 octave_argv.elem (i-1) = argv[i]; 215 {
216 int tmp_len = strlen (argv[i]);
217 if (tmp_len > max_len)
218 max_len = tmp_len;
219 }
220
221 octave_argv.resize (argc-1, max_len, 0);
222
223 for (int i = 1; i < argc; i++)
224 octave_argv.insert (argv[i], i-1, 0);
217 225
218 bind_builtin_variable ("argv", octave_argv, 1, 1, 0); 226 bind_builtin_variable ("argv", octave_argv, 1, 1, 0);
219 } 227 }
220 } 228 }
221 229