From aa9b558bb2318aa2d01c2c25f292fdac8dd0c445 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 27 Feb 2020 22:58:14 -0600 Subject: [PATCH] Restore cygwin/vms only function. fixes #541 --- src/engine/function.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/engine/function.cpp b/src/engine/function.cpp index 805a5f590..71f9b119a 100644 --- a/src/engine/function.cpp +++ b/src/engine/function.cpp @@ -772,6 +772,35 @@ static void var_edit_file( char const * in, string * out, VAR_EDITS * edits ) } +#if defined( OS_CYGWIN ) || defined( OS_VMS ) + +/* + * var_edit_translate_path() - translate path to os native format. + */ + +static void var_edit_translate_path( string * out, size_t pos, VAR_EDITS * edits ) +{ + if ( edits->to_windows ) + { + string result[ 1 ]; + int translated; + + /* Translate path to os native format. */ + translated = path_translate_to_os( out->value + pos, result ); + if ( translated ) + { + string_truncate( out, pos ); + string_append( out, result->value ); + edits->to_slashes = 0; + } + + string_free( result ); + } +} + +#endif + + /* * var_edit_shift() - do upshift/downshift & other mods. */