Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-03-12 15:47:09 +0300
committerCorinna Vinschen <corinna@vinschen.de>2008-03-12 15:47:09 +0300
commit2b2b42cf59bafffa3cd3021090c8e8636985fd48 (patch)
tree23c46e03e638a625c464bc7ccbb31ff795c71257 /winsup/utils/ps.cc
parentedab6053a24d49f3443fbfdbac2c330caf50b030 (diff)
* cygpath.cc (do_sysfolders): Use cygwin_conv_path.
(do_pathconv): Use cygwin_conv_path and cygwin_conv_path_list. * dumper.cc (main): Use cygwin_conv_path. Allocate target path dynamically. * mkpasswd.c (current_user): Use cygwin_conv_path. (enum_users): Ditto. * ps.cc (NT_MAX_PATH): Define. (main): Use cygwin_conv_path. * regtool.cc (find_key): Ditto. Allocate target path dynamically. (cmd_save): Ditto.
Diffstat (limited to 'winsup/utils/ps.cc')
-rw-r--r--winsup/utils/ps.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc
index 2a0ef01c8..5d7559305 100644
--- a/winsup/utils/ps.cc
+++ b/winsup/utils/ps.cc
@@ -20,6 +20,10 @@ details. */
#include <tlhelp32.h>
#include <psapi.h>
+/* Maximum possible path length under NT. There's no official define
+ for that value. Note that PATH_MAX is only 4K. */
+#define NT_MAX_PATH 32768
+
static const char version[] = "$Revision$";
static char *prog_name;
@@ -355,7 +359,9 @@ main (int argc, char *argv[])
else if (p->process_state & PID_TTYOU)
status = 'O';
- char pname[PATH_MAX];
+ /* Maximum possible path length under NT. There's no official define
+ for that value. */
+ char pname[NT_MAX_PATH];
if (p->process_state & PID_EXITED || (p->exitcode & ~0xffff))
strcpy (pname, "<defunct>");
else if (p->ppid)
@@ -363,9 +369,11 @@ main (int argc, char *argv[])
char *s;
pname[0] = '\0';
if (p->version >= EXTERNAL_PINFO_VERSION_32_LP)
- cygwin_conv_to_posix_path (p->progname_long, pname);
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE,
+ p->progname_long, pname, NT_MAX_PATH);
else
- cygwin_conv_to_posix_path (p->progname, pname);
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE,
+ p->progname, pname, NT_MAX_PATH);
s = strchr (pname, '\0') - 4;
if (s > pname && strcasecmp (s, ".exe") == 0)
*s = '\0';