X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=development%2Fcygwin%2Flyxwin.c;h=d1ac5bf0fe627473ee37e6b21b70e53c8600659f;hb=6adae698101dad5d50a66d18f2857b8703055689;hp=d57bfa4e02fb750f8dadb780a37fd63011f85e8d;hpb=68d936250e909b1746ba03968cc5f09b21b5ec04;p=lyx.git diff --git a/development/cygwin/lyxwin.c b/development/cygwin/lyxwin.c index d57bfa4e02..d1ac5bf0fe 100644 --- a/development/cygwin/lyxwin.c +++ b/development/cygwin/lyxwin.c @@ -22,9 +22,19 @@ #include #include #include +#include #include #include +void convert_to_posix_path(char const * from, char *to) +{ +#if CYGWIN_VERSION_DLL_MAJOR >= 1007 + cygwin_conv_path(CCP_WIN_A_TO_POSIX | CCP_RELATIVE, from, to, PATH_MAX); +#else + cygwin_conv_to_posix_path(from, to); +#endif +} + int main (int argc, char **argv, char **environ) { FILE *fp; @@ -44,7 +54,7 @@ int main (int argc, char **argv, char **environ) && strcasecmp(s, ".lyx") == 0; /* Add initial quote */ strcat(cmd, "\""); - cygwin_conv_to_posix_path(argv[i], posixpath) ; + convert_to_posix_path(argv[i], posixpath) ; /* Hack to account for shares */ if (lyxfile && argv[i][0] == '\\' && argv[i][1] != '\\') strcat(cmd, "/"); @@ -64,7 +74,7 @@ int main (int argc, char **argv, char **environ) /* fprintf(stderr , "Command is: |%s|\n", cmd); */ /* ensure bash reads our global env changes */ - putenv("BASH_ENV=/etc/lyxprofile") ; + putenv("BASH_ENV=" LYX_ABS_INSTALLED_DATADIR "/lyxprofile") ; /* exec sub command */ spawnv(_P_NOWAIT, "/bin/bash", nargs); /* exit with no error */