Improve diff-remove-abspath canonifier: collapse '/' sequences

This commit is contained in:
Jon Siwek 2018-08-20 12:45:32 -05:00
parent 6595b21e2e
commit 4912513517
3 changed files with 17 additions and 1 deletions

View file

@ -2,4 +2,11 @@
#
# Replace absolute paths with the basename.
if [ `uname` == "Linux" ]; then
sed="sed -r"
else
sed="sed -E"
fi
$sed 's#/+#/#g' | \
sed 's#/\([^/]\{1,\}/\)\{1,\}\([^/]\{1,\}\)#<...>/\2#g'