Den 2009-01-30 19:28 skrev Charles Wilson:
Charles Wilson wrote:
In fact, maybe I should add $opt_debug to the new func_to_host_path[list]
functions...

Addressed in the attached revision.

*snip*

> +func_msys_to_win32 ()
> +{
> +  $opt_debug
> +  lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
> +  # awkward: cmd appends spaces to result
> +  func_msys_to_win32_result=`( cmd //c echo "$1" ) 2>/dev/null |
> +    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
> +}

Might I suggest

+func_msys_to_win32 ()
+{
+  $opt_debug
+  lt_sed_naive_slashify='s|\\|/|g'
+  # awkward: cmd appends spaces to result
+  func_msys_to_win32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_slashify"`
+}

instead? And perhaps a similar change to func_wine_to_win32_path, but
I have not tested that.

*snip*

After all, you are using
> +    func_to_host_path_result=`cygpath -m "$1"`
in func_cygwin_to_mingw_path_convert, so you appear to be happy with
forward slashes in other places.

The reason I'm requesting this change is that a later patch introducing
func_to_tool_path which reuses these functions will need to quote
paths for eval in some places if they might contain backslashes, and
quoting for eval will cost forks on sane setups that don't deserve to
lose.

Also, I'm curious, what is the difference between mingw and win32 in this
context, i.e. why not name the function func_cygwin_to_win32_path_convert?

Cheers,
peter


Reply via email to