[Bug 915] [PATCH] Only copy basic Windows environment

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sat Aug 28 23:11:46 EST 2004


http://bugzilla.mindrot.org/show_bug.cgi?id=915

dtucker at zip.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
    Attachment #698|                            |ok
             Status|                            |



------- Additional Comments From dtucker at zip.com.au  2004-08-28 23:11 -------
(From update of attachment 698)
Looks OK to me.  A few minor comments:
[...]
>+	p[idx] = NULL;
>+	for (e = environ; *e; ++e) {

style guide says to explicitly test against NULL, ie "*e != NULL"

>+		for (i = 0; i < WENV_SIZ; ++i) {
>+			if (!strncmp(*e, wenv_arr[i].name,
>+				     wenv_arr[i].namelen)) {
>+				p[idx] = *e;
>+				p[++idx] = NULL;

You could make that "p[idx++] = *e", move "p[idx] = NULL" from above the loop
to below and delete "p[++idx] = NULL" from the loop.

It would be nice if the array didn't need to be structs but that would mean a
bit of run-time overhead and I don't think it would be any clearer anyway...




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list