Added -I option to c02 compiler

This commit is contained in:
Curtis F Kaylor 2021-12-18 19:38:15 -05:00
parent e13bd5809c
commit e16b4dbeae
1 changed files with 6 additions and 1 deletions

View File

@ -140,7 +140,7 @@ int popt(int arg, int argc, char *argv[]) {
strncpy (argstr, argv[arg], 31);
if (strlen(argstr) != 2) ERROR("malformed option %s\n", argstr, EXIT_FAILURE)
opt = toupper(argstr[1]);
if (strchr("CHS", opt)) {
if (strchr("CHIS", opt)) {
if (++arg >= argc) ERROR("Option -%c requires an argument\n", opt, EXIT_FAILURE)
strncpy(optarg, argv[arg], 31);
}
@ -158,6 +158,11 @@ int popt(int arg, int argc, char *argv[]) {
strcpy(hdrnam, optarg);
DEBUG("c02.popt: Header Name set to '%s'\n", hdrnam)
break;
case 'I':
strcpy(incdir, optarg);
strcat(incdir, "/");
DEBUG("c02.popt: Include Directory set to '%s'\n", incdir)
break;
case 'S':
strcpy(subdir[subcnt], optarg);
DEBUG("c02.popt: subdir[%d] ", subcnt)