Thread (129 messages) 129 messages, 7 authors, 2017-04-25

Re: [PATCH v4 05/10] run-command: prepare child environment before forking

From: Brandon Williams <hidden>
Date: 2017-04-18 21:02:58

On 04/18, Eric Wong wrote:
quoted
+static int env_isequal(const char *e1, const char *e2)
+{
+	for (;;) {
+		char c1 = *e1++;
+		char c2 = *e2++;
+		c1 = (c1 == '=') ? '\0' : tolower(c1);
+		c2 = (c2 == '=') ? '\0' : tolower(c2);
Dealing with C strings scares me so maybe I'm misreading;
but: why is this comparison case-insensitive?
Well i was pulling inspiration from the stuff in mingw.c...looks like i
probably shouldn't have done so as you're correct, they should be
case-sensitive.  Jonathan pointed out that doing this env stuff in
vanilla C may not be a good idea...and I kinda forgot about that cause
it worked (it passed tests) Let me re-write this section of code to make
it correct, and saner.

-- 
Brandon Williams
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help