http://bugs.winehq.org/show_bug.cgi?id=19856
--- Comment #3 from Dan Kegel dank@kegel.com 2009-08-27 20:11:47 --- Reproducible with a very small C program:
#include <stdio.h> #include <stdlib.h> int main(int argc, char **argv, char **env) { char *newargv[] = { "/usr/sbin/update-alternatives", NULL }; char *newenviron[] = { NULL }; execve("/usr/sbin/update-alternatives", newargv, env); perror("Returned? "); }
cygwin's strace on that test app provides a useful clue. On cygwin/Windows, that prints the usage message for update-alternatives. On cygwin/wine, it screws up, thinks update-alternatives is a shell script, and tries to run it via sh (without -c). The problem seems to be that on cygwin/windows, the path is canonicalized with a .exe on the end; that doesn't happen on wine for some reason.
I suspect path_conv::check() and path_conv::add_ext_from_sym() in http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/path.cc?cvsroot=src are involved but it's hard to read.