View | Details | Raw Unified | Return to bug 73500
Collapse All | Expand All

(-)src/bin/sh/options.c (-11 / +6 lines)
Lines 196-202 Link Here
196
STATIC void
196
STATIC void
197
minus_o(char *name, int val)
197
minus_o(char *name, int val)
198
{
198
{
199
	int doneset, i;
199
	int i;
200
200
201
	if (name == NULL) {
201
	if (name == NULL) {
202
		if (val) {
202
		if (val) {
Lines 207-222 Link Here
207
					optlist[i].val ? "on" : "off");
207
					optlist[i].val ? "on" : "off");
208
		} else {
208
		} else {
209
			/* Output suitable for re-input to shell. */
209
			/* Output suitable for re-input to shell. */
210
			for (doneset = i = 0; i < NOPTS; i++)
210
			out1str("set");
211
				if (optlist[i].val) {
211
			for (i = 0; i < NOPTS; i++)
212
					if (!doneset) {
212
				out1fmt(" %co %s", optlist[i].val ? '-' : '+',
213
						out1str("set");
213
					optlist[i].name);
214
						doneset = 1;
214
			out1c('\n');
215
					}
216
					out1fmt(" -o %s", optlist[i].name);
217
				}
218
			if (doneset)
219
				out1c('\n');
220
		}
215
		}
221
	} else {
216
	} else {
222
		for (i = 0; i < NOPTS; i++)
217
		for (i = 0; i < NOPTS; i++)

Return to bug 73500