summaryrefslogtreecommitdiff
path: root/usr/src/cmd/env
diff options
context:
space:
mode:
authorRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-08-12 14:55:22 -0700
committerRoger A. Faulkner <Roger.Faulkner@Oracle.COM>2010-08-12 14:55:22 -0700
commit23a1ccea6aac035f084a7a4cdc968687d1b02daf (patch)
tree6ed5e310ce6dd96f997b0c0f9735805d513d898a /usr/src/cmd/env
parent29c3196fe2acc65721d8b9b5ea708d3a87facde0 (diff)
downloadillumos-joyent-23a1ccea6aac035f084a7a4cdc968687d1b02daf.tar.gz
PSARC 2010/299 GNU/Linux/BSD compatibility functions
6960818 add get_nprocs(), getline(), strdupa(), strndup() to libc 6901783 strndup would be nice 6824404 libc should provide ffsl() & ffsll() 6793969 RFE: Add|stpcpy|to libc 6735446 Want a __progname symbol for BSD-style source compatibility 6421095 Solaris should provide strcasestr 6275498 Provide string compare functions wcscasecmp,wcsncasecmp in solaris like linux --HG-- rename : usr/src/lib/libc/port/gen/strcasecmp.c => usr/src/lib/libc/port/gen/ascii_strcasecmp.c rename : usr/src/lib/libc/port/gen/strncasecmp.c => usr/src/lib/libc/port/gen/ascii_strncasecmp.c rename : usr/src/lib/libc/sparc/gen/strcasecmp.s => usr/src/lib/libc/sparc/gen/ascii_strcasecmp.s rename : usr/src/lib/libc/sparcv9/gen/strcasecmp.s => usr/src/lib/libc/sparcv9/gen/ascii_strcasecmp.s
Diffstat (limited to 'usr/src/cmd/env')
-rw-r--r--usr/src/cmd/env/env.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/usr/src/cmd/env/env.c b/usr/src/cmd/env/env.c
index bbd146bc62..ff2b2c4b31 100644
--- a/usr/src/cmd/env/env.c
+++ b/usr/src/cmd/env/env.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,23 +18,22 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
- * All Rights Reserved
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
+ * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
+ * All Rights Reserved
*/
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */
-
/*
* env [ - ] [ name=value ]... [command arg...]
* set environment, then execute command (or print environment)
* - says start fresh, otherwise merge with inherited environment
*/
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -49,7 +47,6 @@
static void Usage();
-static char *nullp = NULL;
extern char **environ;
@@ -70,7 +67,7 @@ main(int argc, char **argv)
/* check for non-standard "-" option */
if ((argc > 1) && (strcmp(argv[1], "-")) == 0) {
- environ = &nullp;
+ (void) clearenv();
for (i = 1; i < argc; i++)
argv[i] = argv[i+1];
argc--;
@@ -80,7 +77,7 @@ main(int argc, char **argv)
while ((opt = getopt(argc, argv, "i")) != EOF) {
switch (opt) {
case 'i':
- environ = &nullp;
+ (void) clearenv();
break;
default: