Re: [PATCH 2/2] git-sh-setup: work around Cygwin path handling gotchas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx> writes:

> However, you could imagine adding code to accommodate external windows
> programs. If we limit ourselves to the text editor, for example, I could
> imagine something like the diff attached below to fix up the C based git
> programs. (You would need to make similar changes to the shell and perl
> scripts which launch the text editor).

If you _only_ allow editors that understands windows style paths, your
patch may make sense, but doesn't it break editors that wants only POSIX
style paths?

>
> ATB,
> Ramsay Jones
>
> -- >8 --
> diff --git a/editor.c b/editor.c
> index d834003..cf36e62 100644
> --- a/editor.c
> +++ b/editor.c
> @@ -1,6 +1,9 @@
>  #include "cache.h"
>  #include "strbuf.h"
>  #include "run-command.h"
> +#ifdef __CYGWIN__
> +# include <sys/cygwin.h>
> +#endif
>  
>  #ifndef DEFAULT_EDITOR
>  #define DEFAULT_EDITOR "vi"
> @@ -37,6 +40,12 @@ int launch_editor(const char *path, struct strbuf *buffer, const char *const *en
>  
>  	if (strcmp(editor, ":")) {
>  		const char *args[] = { editor, path, NULL };
> +#ifdef __CYGWIN__
> +		char win32_path[1024];
> +
> +		cygwin_conv_to_full_win32_path(path, win32_path);
> +		args[1] = win32_path;
> +#endif
>  
>  		if (run_command_v_opt_cd_env(args, RUN_USING_SHELL, NULL, env))
>  			return error("There was a problem with the editor '%s'.",
> -- 8< --
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]