comparison main.c @ 45:f263adbf7445

merge
author David A. Holland
date Sat, 30 Mar 2013 22:33:53 -0400
parents 57e0c7a50b2d
children dc63e70e425d
comparison
equal deleted inserted replaced
42:ad7763329eba 45:f263adbf7445
502 } 502 }
503 503
504 //////////////////////////////////////////////////////////// 504 ////////////////////////////////////////////////////////////
505 // complex modes 505 // complex modes
506 506
507 static 507 __dead static
508 void 508 void
509 commandline_iremap(const struct place *p, char *str) 509 commandline_iremap(const struct place *p, char *str)
510 { 510 {
511 (void)p; 511 (void)p;
512 /* XXX */ 512 /* XXX */
822 822
823 static 823 static
824 bool 824 bool
825 check_prefix_option(const struct place *p, char *opt) 825 check_prefix_option(const struct place *p, char *opt)
826 { 826 {
827 unsigned i; 827 unsigned i, len;
828 int r; 828 int r;
829 829
830 for (i=0; i<num_prefix_options; i++) { 830 for (i=0; i<num_prefix_options; i++) {
831 r = strncmp(opt, prefix_options[i].string, 831 len = strlen(prefix_options[i].string);
832 strlen(prefix_options[i].string)); 832 r = strncmp(opt, prefix_options[i].string, len);
833 if (r == 0) { 833 if (r == 0) {
834 prefix_options[i].func(p, opt); 834 prefix_options[i].func(p, opt + len);
835 return true; 835 return true;
836 } 836 }
837 if (r < 0) { 837 if (r < 0) {
838 break; 838 break;
839 } 839 }
863 } 863 }
864 } 864 }
865 return false; 865 return false;
866 } 866 }
867 867
868 static 868 __dead static
869 void 869 void
870 usage(void) 870 usage(void)
871 { 871 {
872 fprintf(stderr, "Usage: %s [options] [infile [outfile]]\n", 872 fprintf(stderr, "Usage: %s [options] [infile [outfile]]\n",
873 getprogname()); 873 getprogname());