eric pouech (@epo) commented about programs/cmd/builtins.c:
if (string[count-2] == '\r') string[count-2] = '\0'; /* Under Windoze we get CRLF! */ WINE_TRACE("set /p: Setting var '%s' to '%s'\n", wine_dbgstr_w(s), wine_dbgstr_w(string));
SetEnvironmentVariableW(s, string);
if(wcslen(string)) SetEnvironmentVariableW(s, string);
nitpick: no need to call wcslen, testing *string is sufficient