Re: [PATCH v2] mergetools: add winmerge as a builtin tool

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

 



> for directory in "$(env | grep -E '^PROGRAM(FILES(\(X86\))?|W6432)=' | cut -d '=' -f 2 | sort -u)"
> do
>      test -n "$directory" &&
>      test -x "$directory/$winmerge_exe" &&
>      echo "$directory/$winmerge_exe" &&
>      break
> done

This ain't gonna work, because the output of the pipe won't be split
because of the quotes around the command substitution, so $directory will
hold everything.  Simply loosing those quotes is not good either, because
the output will be split on the spaces as well, leading to 'C:\Program',
'Files' and '(x86)', unless the space is already removed from IFS.  IIRC
Windows doesn't allow newlines in pathnames, so IFS=$'\n' and removing the
quotes around the command substitution should do the trick.

Pathnames can contain '=' characters, so, while I think it's outrageous,
the paths in those variables can also contain an '=' or two.  Well,
theoretically, at least, and in that case the 'cut -d= -f2' will cut off
the end of the pathname.  I don't know whether this is something to be
worth worrying about, but in that case it should be 'cut -d= -f2-'.


G�r
--
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]