Loading... (original) (raw)

In our configure code for rewriting cygwin paths reliably, we use this construct to find the root of the cygwin installation:

# The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"`

This used to work fine for a long time, but with the latest version of cygwin grep, it no longer removes \r from the string. A more robust implementation would be to instead use tr to explicitly remove both \r and \n.