﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
287	Prioritize SHELL over EMXSHELL	dmik	bird	"The `EMXSHELL` is used to override `COMSPEC` for `popen()` and `system()` calls in kLIBC. The order of checking in the first case is `EMXSHELL, COMSPEC` and in the second — `EMXSHELL, COMSPEC, OS2_SHELL, SHELL`.

At the same time, many scripts in the unix environment (e.g. configure scripts) use `SHELL` to override the shell command to use. However, given that in the first case `SHELL` isn't used at all and in the second case it's checked after `EMXSHELL` and `COMSPEC`, even if the script sets `SHELL` (e.g. to point to sh.exe), kLIBC will not notice this and will still use the value of `COMSPEC` (which is usually `cmd.exe`). Not quite what the scripts expect.

I think it makes sense to check for `SHELL` before checking for `EMXSHELL` or `COMSPEC`. The order should be the same in both calls: `SHELL, EMXSHELL, COMSPEC, OS2_SHELL`.

The patch is trivial (in files lib/io/popen.c and lib/process/system.c) so not attaching it here."	defect	closed	normal	libc-0.6.6	libc	0.6.5	normal	fixed		
