More options parse return values

This commit is contained in:
Pasi Kallinen
2017-09-09 14:03:28 +03:00
parent cfb09c9bf8
commit 873590afc1
+19 -13
View File
@@ -1200,7 +1200,7 @@ int iscompound; /* 0 == boolean option, 1 == compound */
* For now just return. * For now just return.
*/ */
#else /* !MAC */ #else /* !MAC */
config_error_add("%s option specified multiple times: %s.\n", config_error_add("%s option specified multiple times: %s",
iscompound ? "compound" : "boolean", opts); iscompound ? "compound" : "boolean", opts);
#endif /* ?MAC */ #endif /* ?MAC */
return; return;
@@ -1872,21 +1872,23 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, "female", 3, FALSE)) { if (match_optname(opts, "female", 3, FALSE)) {
if (duplicate_opt_detection(opts, 0)) if (duplicate_opt_detection(opts, 0))
complain_about_duplicate(opts, 0); complain_about_duplicate(opts, 0);
if (!initial && flags.female == negated) if (!initial && flags.female == negated) {
pline("That is not anatomically possible."); config_error_add("That is not anatomically possible.");
else return FALSE;
} else
flags.initgend = flags.female = !negated; flags.initgend = flags.female = !negated;
return FALSE; return retval;
} }
if (match_optname(opts, "male", 4, FALSE)) { if (match_optname(opts, "male", 4, FALSE)) {
if (duplicate_opt_detection(opts, 0)) if (duplicate_opt_detection(opts, 0))
complain_about_duplicate(opts, 0); complain_about_duplicate(opts, 0);
if (!initial && flags.female != negated) if (!initial && flags.female != negated) {
pline("That is not anatomically possible."); config_error_add("That is not anatomically possible.");
else return FALSE;
} else
flags.initgend = flags.female = negated; flags.initgend = flags.female = negated;
return FALSE; return retval;
} }
#if defined(MICRO) && !defined(AMIGA) #if defined(MICRO) && !defined(AMIGA)
@@ -1909,7 +1911,8 @@ boolean tinitial, tfrom_file;
config_error_add("Unknown %s '%s'", fullname, op); config_error_add("Unknown %s '%s'", fullname, op);
return FALSE; return FALSE;
} }
} } else
return FALSE;
return retval; return retval;
} }
@@ -1923,7 +1926,8 @@ boolean tinitial, tfrom_file;
return FALSE; return FALSE;
} else /* Backwards compatibility */ } else /* Backwards compatibility */
nmcpy(pl_character, op, PL_NSIZ); nmcpy(pl_character, op, PL_NSIZ);
} } else
return FALSE;
return retval; return retval;
} }
@@ -1936,7 +1940,8 @@ boolean tinitial, tfrom_file;
return FALSE; return FALSE;
} else /* Backwards compatibility */ } else /* Backwards compatibility */
pl_race = *op; pl_race = *op;
} } else
return FALSE;
return retval; return retval;
} }
@@ -1949,7 +1954,8 @@ boolean tinitial, tfrom_file;
return FALSE; return FALSE;
} else } else
flags.female = flags.initgend; flags.female = flags.initgend;
} } else
return FALSE;
return retval; return retval;
} }