This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/2] Remove old Cygwin1.5 support
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Date: Fri, 8 Apr 2011 00:44:27 +0100
- Subject: Re: [RFA 2/2] Remove old Cygwin1.5 support
- References: <005101cbf4ae$1dca5fc0$595f1f40$@muller@ics-cnrs.unistra.fr>
On Wednesday 06 April 2011 23:58:17, Pierre Muller wrote:
> if (path_ptr)
> {
> + int len = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, NULL,
> 0);
Your use of `len' for the variable's name confused me into
thinking there's an off-by-one below. The cygwin_conv_path_list function
returns a byte size including the null terminator, not a string
length. Please rename the variable to `size'. Okay with that change.
> orig_path = alloca (strlen (path_ptr) + 1);
> - new_path = alloca (cygwin_posix_to_win32_path_list_buf_size
> (path_ptr));
> + new_path = alloca (len);
> strcpy (orig_path, path_ptr);
> - cygwin_posix_to_win32_path_list (path_ptr, new_path);
> + cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, new_path, len);
> setenv ("PATH", new_path, 1);
--
Pedro Alves