comparison src/utils.cc @ 712:36ba0576bd1b

[project @ 1994-09-19 14:18:15 by jwe]
author jwe
date Mon, 19 Sep 1994 14:18:48 +0000
parents d7c4962ec7a0
children 02814aea28c8
comparison
equal deleted inserted replaced
711:5f15ab42a631 712:36ba0576bd1b
496 496
497 static int 497 static int
498 all_strings (const Octave_object& args) 498 all_strings (const Octave_object& args)
499 { 499 {
500 int n = args.length (); 500 int n = args.length ();
501 for (int i = 1; i < n; i++) 501 for (int i = 0; i < n; i++)
502 if (! args(i).is_string ()) 502 if (! args(i).is_string ())
503 return 0; 503 return 0;
504 return 1; 504 return 1;
505 } 505 }
506 506
511 if (all_strings (args)) 511 if (all_strings (args))
512 { 512 {
513 int n = args.length (); 513 int n = args.length ();
514 argv = new char * [n + 1]; 514 argv = new char * [n + 1];
515 argv[0] = strsave (fcn_name); 515 argv[0] = strsave (fcn_name);
516 for (int i = 1; i < n; i++) 516 for (int i = 0; i < n; i++)
517 argv[i] = strsave (args(i).string_value ()); 517 argv[i+1] = strsave (args(i).string_value ());
518 } 518 }
519 else 519 else
520 error ("%s: expecting all arguments to be strings", fcn_name); 520 error ("%s: expecting all arguments to be strings", fcn_name);
521 521
522 return argv; 522 return argv;