-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to latest Lindent script from kernel tree.
Signed-off-by: Stephen Smalley <[email protected]>
- Loading branch information
1 parent
6abcb4f
commit c525be3
Showing
1 changed file
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
#!/bin/sh | ||
|
||
perl -e 'undef $/;' -pi \ | ||
-e 's|#ifdef __cplusplus\n(.*?)\n#endif|//__CPP \1|g' "$@" | ||
|
||
indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs "$@" | ||
|
||
perl -pi -e 's|^//__CPP (.*)$|#ifdef __cplusplus\n\1\n#endif|' "$@" | ||
PARAM="-npro -kr -i8 -ts8 -sob -l80 -ss -ncs -cp1" | ||
RES=`indent --version` | ||
V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1` | ||
V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2` | ||
V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3` | ||
if [ $V1 -gt 2 ]; then | ||
PARAM="$PARAM -il0" | ||
elif [ $V1 -eq 2 ]; then | ||
if [ $V2 -gt 2 ]; then | ||
PARAM="$PARAM -il0"; | ||
elif [ $V2 -eq 2 ]; then | ||
if [ $V3 -ge 10 ]; then | ||
PARAM="$PARAM -il0" | ||
fi | ||
fi | ||
fi | ||
indent $PARAM "$@" |