fetch saved option string for a particular option phase */
| 731 | |
| 732 | /* fetch saved option string for a particular option phase */ |
| 733 | staticfn char * |
| 734 | getoptstr(int optidx, int ophase) |
| 735 | { |
| 736 | int roleoptindx = opt2roleopt(optidx); |
| 737 | |
| 738 | if (ophase == num_opt_phases) { /* any source */ |
| 739 | int phase; |
| 740 | |
| 741 | /* find non-Null, in order optvals[][play_opt], [cmdline_opt], |
| 742 | [environ_opt], [rc_file_opt], [syscf_opt], [builtin_opt] */ |
| 743 | for (phase = num_opt_phases - 1; phase >= 0; --phase) |
| 744 | if (roleoptvals[roleoptindx][phase]) { |
| 745 | ophase = phase; |
| 746 | break; |
| 747 | } |
| 748 | } |
| 749 | if ((roleoptindx >= 0 && roleoptindx < MAX_ROLEOPT |
| 750 | && ophase >= 0 && ophase < num_opt_phases)) |
| 751 | return roleoptvals[roleoptindx][ophase]; |
| 752 | panic("bad index roleoptvals[%d][%d]", roleoptindx, ophase); |
| 753 | /*NOTREACHED*/ |
| 754 | } |
| 755 | |
| 756 | /* to track some unparsed option settings in case #saveoptions needs them */ |
| 757 | staticfn void |
no test coverage detected