options.c (8832864298b522bb2b4b3d2fdb1fa0443bedd681) | options.c (aeb5d065044ee6733a7fee14edb52959a28c1ab4) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 247 unchanged lines hidden (view full) --- 256 if (val) { 257 /* "Pretty" output. */ 258 out1str("Current option settings\n"); 259 for (i = 0; i < NOPTS; i++) 260 out1fmt("%-16s%s\n", optlist[i].name, 261 optlist[i].val ? "on" : "off"); 262 } else { 263 /* Output suitable for re-input to shell. */ | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 247 unchanged lines hidden (view full) --- 256 if (val) { 257 /* "Pretty" output. */ 258 out1str("Current option settings\n"); 259 for (i = 0; i < NOPTS; i++) 260 out1fmt("%-16s%s\n", optlist[i].name, 261 optlist[i].val ? "on" : "off"); 262 } else { 263 /* Output suitable for re-input to shell. */ |
264 for (i = 0; i < NOPTS; i++) { 265 if (i % 6 == 0) 266 out1str(i == 0 ? "set" : "\nset"); 267 out1fmt(" %co %s", optlist[i].val ? '-' : '+', 268 optlist[i].name); 269 } 270 out1c('\n'); | 264 for (i = 0; i < NOPTS; i++) 265 out1fmt("%s %co %s%s", 266 i % 6 == 0 ? "set" : "", 267 optlist[i].val ? '-' : '+', 268 optlist[i].name, 269 i % 6 == 5 || i == NOPTS - 1 ? "\n" : ""); |
271 } 272 } else { 273 for (i = 0; i < NOPTS; i++) 274 if (equal(name, optlist[i].name)) { 275 if (!val && privileged && equal(name, "privileged")) { 276 (void) setuid(getuid()); 277 (void) setgid(getgid()); 278 } --- 311 unchanged lines hidden --- | 270 } 271 } else { 272 for (i = 0; i < NOPTS; i++) 273 if (equal(name, optlist[i].name)) { 274 if (!val && privileged && equal(name, "privileged")) { 275 (void) setuid(getuid()); 276 (void) setgid(getgid()); 277 } --- 311 unchanged lines hidden --- |