When $(PWD) has a symlinked directory, in function __gs_relative_path, the comparison becomes between an absolute path and symlinked directory, resulting in the while loop never terminating, and "gs" for example getting stuck forever. The patch first resolves $(PWD) to an absolute path.
For example I have a ~/work directory that maps to the base of all my sources, and I typically do |cd ~/work| to go there.
Avoid infinite loop in __gs_relative_path when $(PWD) contains a syml…
Sorry there is a bug in my fix