Project

General

Profile

Bug #1341 ยป printenv.diff

Anonymous, 04/20/2009 06:58 PM

View differences:

usr.bin/printenv/printenv.c
77 77
	}
78 78
	len = strlen(*argv);
79 79
	for (ep = environ; *ep != NULL; ep++) {
80
		if (memcmp(*ep, *argv, len) == 0) {
81
			cp = *ep + len;
82
			if (*cp == '=') {
80
		cp = strchr(*ep, '=');
81
		if (cp == *ep + len) {
82
			if (memcmp(*ep, *argv, len) == 0) {
83 83
				printf("%s\n", cp + 1);
84 84
				exit(0);
85 85
			}
86
			if (*cp == '\0')
87
				exit(0);
88 86
		}
89 87
	}
90 88
	exit(1);
    (1-1/1)