mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
uncrustify: move annotation by offset
This commit is contained in:
parent
b52ddefccd
commit
254af225c9
10
dist/tools/uncrustify/uncrustify.sh
vendored
10
dist/tools/uncrustify/uncrustify.sh
vendored
@ -75,6 +75,16 @@ exec_uncrustify () {
|
||||
DIFF="--- $DIFFFILE\n+++ $DIFFFILE"
|
||||
fi
|
||||
DIFFLINE="$(echo "$line" | sed 's/@@ -\([0-9]\+\).*$/\1/')"
|
||||
# Parse
|
||||
# @@ -<DIFFLINE>,<DIFFOFFSET> ...
|
||||
DIFFOFFSET="$(echo "$line" |
|
||||
sed 's/@@ -[0-9]\+\(,\([0-9]\+\)\)\?.*$/\2/')"
|
||||
if [ -n "$DIFFOFFSET" ]; then
|
||||
# if there is a DIFFOFFSET, add it to
|
||||
# DIFFLINE. DIFFLINE starts at 1, so we
|
||||
# need to subtract 1 to not overshoot.
|
||||
DIFFLINE=$(( DIFFLINE + DIFFOFFSET - 1 ))
|
||||
fi
|
||||
fi
|
||||
DIFF="$DIFF\n${line//\\/\\\\}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user