summaryrefslogtreecommitdiffstats
path: root/winsup/utils/regtool.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-03-12 12:47:09 +0000
committerCorinna Vinschen <corinna@vinschen.de>2008-03-12 12:47:09 +0000
commit2b2b42cf59bafffa3cd3021090c8e8636985fd48 (patch)
tree23c46e03e638a625c464bc7ccbb31ff795c71257 /winsup/utils/regtool.cc
parentedab6053a24d49f3443fbfdbac2c330caf50b030 (diff)
downloadcygnal-2b2b42cf59bafffa3cd3021090c8e8636985fd48.tar.gz
cygnal-2b2b42cf59bafffa3cd3021090c8e8636985fd48.tar.bz2
cygnal-2b2b42cf59bafffa3cd3021090c8e8636985fd48.zip
* 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/regtool.cc')
-rw-r--r--winsup/utils/regtool.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc
index 6da9845f9..4bda9e646 100644
--- a/winsup/utils/regtool.cc
+++ b/winsup/utils/regtool.cc
@@ -414,8 +414,11 @@ find_key (int howmanyparts, REGSAM access, int option = 0)
}
else if (argv[1])
{
- char win32_path[MAX_PATH];
- cygwin_conv_to_win32_path (argv[1], win32_path);
+ ssize_t len = cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE,
+ argv[1], NULL, 0);
+ char win32_path[len];
+ cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE, argv[1],
+ win32_path, len);
rv = RegLoadKey (base, n, win32_path);
if (rv != ERROR_SUCCESS)
Fail (rv);
@@ -849,8 +852,11 @@ cmd_save ()
set_privilege (SE_BACKUP_NAME);
/* REG_OPTION_BACKUP_RESTORE is necessary to save /HKLM/SECURITY */
find_key (1, KEY_QUERY_VALUE, REG_OPTION_BACKUP_RESTORE);
- char win32_path[MAX_PATH];
- cygwin_conv_to_win32_path (argv[1], win32_path);
+ ssize_t len = cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE,
+ argv[1], NULL, 0);
+ char win32_path[len];
+ cygwin_conv_path (CCP_POSIX_TO_WIN_A | CCP_RELATIVE, argv[1],
+ win32_path, len);
DWORD rv = RegSaveKey (key, win32_path, NULL);
if (rv != ERROR_SUCCESS)
Fail (rv);