Module Name:    src
Committed By:   gson
Date:           Sun Oct  3 08:21:28 UTC 2010

Modified Files:
        src/bin/date: date.c

Log Message:
Simplify by using setenv() instead of putenv().


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/bin/date/date.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/date/date.c
diff -u src/bin/date/date.c:1.54 src/bin/date/date.c:1.55
--- src/bin/date/date.c:1.54	Sat Oct  2 08:26:09 2010
+++ src/bin/date/date.c	Sun Oct  3 08:21:27 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: date.c,v 1.54 2010/10/02 08:26:09 gson Exp $ */
+/* $NetBSD: date.c,v 1.55 2010/10/03 08:21:27 gson Exp $ */
 
 /*
  * Copyright (c) 1985, 1987, 1988, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)date.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: date.c,v 1.54 2010/10/02 08:26:09 gson Exp $");
+__RCSID("$NetBSD: date.c,v 1.55 2010/10/03 08:21:27 gson Exp $");
 #endif
 #endif /* not lint */
 
@@ -79,7 +79,6 @@
 	size_t bufsiz;
 	const char *format;
 	int ch;
-	static char tz_utc0[] = "TZ=UTC0";
 
 	setprogname(argv[0]);
 	(void)setlocale(LC_ALL, "");
@@ -107,7 +106,7 @@
 			tval = strtoll(optarg, NULL, 0);
 			break;
 		case 'u':		/* do everything in UTC */
-			(void)putenv(tz_utc0);
+			(void)setenv("TZ", "UTC0", 1);
 			break;
 		default:
 			usage();

Reply via email to