mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 22:43:50 +01:00
coccinelle: move annotation by offset
This commit is contained in:
parent
6f365f6e43
commit
c6260f29b3
10
dist/tools/coccinelle/check.sh
vendored
10
dist/tools/coccinelle/check.sh
vendored
@ -85,6 +85,16 @@ coccinelle_checkone() {
|
||||
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…
x
Reference in New Issue
Block a user