Deleted Added
full compact
var.c (194765) var.c (199660)
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

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
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

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/bin/sh/var.c 194765 2009-06-23 20:45:12Z jilles $");
39__FBSDID("$FreeBSD: head/bin/sh/var.c 199660 2009-11-22 18:23:30Z jilles $");
40
41#include <unistd.h>
42#include <stdlib.h>
43#include <paths.h>
44
45/*
46 * Shell variables.
47 */

--- 142 unchanged lines hidden (view full) ---

190 */
191
192int
193setvarsafe(char *name, char *val, int flags)
194{
195 struct jmploc jmploc;
196 struct jmploc *const savehandler = handler;
197 int err = 0;
40
41#include <unistd.h>
42#include <stdlib.h>
43#include <paths.h>
44
45/*
46 * Shell variables.
47 */

--- 142 unchanged lines hidden (view full) ---

190 */
191
192int
193setvarsafe(char *name, char *val, int flags)
194{
195 struct jmploc jmploc;
196 struct jmploc *const savehandler = handler;
197 int err = 0;
198 int inton;
198
199
200 inton = is_int_on();
199 if (setjmp(jmploc.loc))
200 err = 1;
201 else {
202 handler = &jmploc;
203 setvar(name, val, flags);
204 }
205 handler = savehandler;
201 if (setjmp(jmploc.loc))
202 err = 1;
203 else {
204 handler = &jmploc;
205 setvar(name, val, flags);
206 }
207 handler = savehandler;
208 SETINTON(inton);
206 return err;
207}
208
209/*
210 * Set the value of a variable. The flags argument is stored with the
211 * flags of the variable. If val is NULL, the variable is unset.
212 */
213

--- 652 unchanged lines hidden ---
209 return err;
210}
211
212/*
213 * Set the value of a variable. The flags argument is stored with the
214 * flags of the variable. If val is NULL, the variable is unset.
215 */
216

--- 652 unchanged lines hidden ---