comparison arogue7/options.c @ 266:08489644940b

Merge the UltraRogue branch.
author John "Elwin" Edwards
date Sun, 19 Feb 2017 19:56:43 -0500
parents e940e6c00751
children d3968e9cb98d
comparison
equal deleted inserted replaced
265:7fcb2f9f57e6 266:08489644940b
348 len = (int)(sp - str); 348 len = (int)(sp - str);
349 /* 349 /*
350 * Look it up and deal with it 350 * Look it up and deal with it
351 */ 351 */
352 for (op = optlist; op <= &optlist[NUM_OPTS-1]; op++) 352 for (op = optlist; op <= &optlist[NUM_OPTS-1]; op++)
353 {
353 if (EQSTR(str, op->o_name, len)) 354 if (EQSTR(str, op->o_name, len))
354 { 355 {
355 if (op->o_putfunc == put_bool) /* if option is a boolean */ 356 if (op->o_putfunc == put_bool) /* if option is a boolean */
356 *(bool *)op->o_opt = TRUE; 357 *(bool *)op->o_opt = TRUE;
357 else /* string option */ 358 else /* string option */
410 && EQSTR(str, "no", 2) && EQSTR(str + 2, op->o_name, len - 2)) 411 && EQSTR(str, "no", 2) && EQSTR(str + 2, op->o_name, len - 2))
411 { 412 {
412 *(bool *)op->o_opt = FALSE; 413 *(bool *)op->o_opt = FALSE;
413 break; 414 break;
414 } 415 }
416 }
415 417
416 /* 418 /*
417 * skip to start of next option name 419 * skip to start of next option name
418 */ 420 */
419 while (*sp && !isalpha(*sp)) 421 while (*sp && !isalpha(*sp))