From fa10472e4a49b10361b85736b8d8c75895db4edb Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 17 Oct 2003 17:19:31 +0000 Subject: [PATCH] * cygcheck.cc (pretty_id): Don't exec if `id' program is not found. --- winsup/utils/ChangeLog | 4 ++++ winsup/utils/Makefile.in | 6 +++--- winsup/utils/cygcheck.cc | 5 +---- winsup/utils/cygpath.cc | 27 ++++++++------------------- 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 819c5b16b..6f53240b5 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,7 @@ +2003-10-17 Christopher Faylor + + * cygcheck.cc (pretty_id): Don't exec if `id' program is not found. + 2003-09-20 Christopher Faylor * kill.cc (main): Allow negative pids (indicates process groups). diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in index 74a38e6d8..ba7b0d63f 100644 --- a/winsup/utils/Makefile.in +++ b/winsup/utils/Makefile.in @@ -77,10 +77,10 @@ PROGS:= cygcheck.exe cygpath.exe getfacl.exe kill.exe mkgroup.exe \ ssp.exe strace.exe umount.exe CLEAN_PROGS:=$(PROGS) -ifdef build_dumper -PROGS+=dumper$(EXEEXT) -else +ifndef build_dumper PROGS:=warn_dumper $(PROGS) +else +PROGS+=dumper$(EXEEXT) CLEAN_PROGS+=dumper.exe endif diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 91eb6da49..7adc4c1ec 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -780,10 +780,7 @@ pretty_id (const char *s, char *cygwin, size_t cyglen) *p = '\\'; if (access (id, X_OK)) - { - fprintf (stderr, "`id' program not found\n"); - exit (1); - } + fprintf (stderr, "`id' program not found\n"); FILE *f = popen (id, "rt"); diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc index 68a2407fc..66a4aa31d 100644 --- a/winsup/utils/cygpath.cc +++ b/winsup/utils/cygpath.cc @@ -9,6 +9,8 @@ details. */ #define NOCOMATTRIBUTE +#define _WIN32_IE 0x0400 + #include #include #include @@ -330,7 +332,6 @@ dowin (char option) char *buf, buf1[MAX_PATH], buf2[MAX_PATH]; DWORD len = MAX_PATH; WIN32_FIND_DATA w32_fd; - LPITEMIDLIST id; HINSTANCE k32; BOOL (*GetProfilesDirectoryAPtr) (LPSTR, LPDWORD) = 0; @@ -338,27 +339,15 @@ dowin (char option) switch (option) { case 'D': - SHGetSpecialFolderLocation (NULL, allusers_flag ? - CSIDL_COMMON_DESKTOPDIRECTORY : CSIDL_DESKTOPDIRECTORY, &id); - SHGetPathFromIDList (id, buf); - /* This if clause is a Fix for Win95 without any "All Users" */ - if (strlen (buf) == 0) - { - SHGetSpecialFolderLocation (NULL, CSIDL_DESKTOPDIRECTORY, &id); - SHGetPathFromIDList (id, buf); - } + if (!SHGetSpecialFolderPath (NULL, buf, allusers_flag ? + CSIDL_COMMON_DESKTOPDIRECTORY : CSIDL_DESKTOPDIRECTORY, FALSE)) + SHGetSpecialFolderPath (NULL, buf, CSIDL_DESKTOPDIRECTORY, FALSE); break; case 'P': - SHGetSpecialFolderLocation (NULL, allusers_flag ? - CSIDL_COMMON_PROGRAMS : CSIDL_PROGRAMS, &id); - SHGetPathFromIDList (id, buf); - /* This if clause is a Fix for Win95 without any "All Users" */ - if (strlen (buf) == 0) - { - SHGetSpecialFolderLocation (NULL, CSIDL_PROGRAMS, &id); - SHGetPathFromIDList (id, buf); - } + if (!SHGetSpecialFolderPath (NULL, buf, allusers_flag ? + CSIDL_COMMON_PROGRAMS : CSIDL_PROGRAMS, FALSE)) + SHGetSpecialFolderPath (NULL, buf, CSIDL_PROGRAMS, FALSE); break; case 'H':