nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiaoxi...@apache.org
Subject [incubator-nuttx] branch master updated: tools/checkpatch.sh: enhance added files judgement with +++ at the line beginning
Date Thu, 16 Apr 2020 09:13:15 GMT
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 773f540  tools/checkpatch.sh: enhance added files judgement with +++ at the line
beginning
773f540 is described below

commit 773f540d747c8ee6c5f56261395f7b4634acbbaa
Author: liuhaitao <liuhaitao@xiaomi.com>
AuthorDate: Thu Apr 16 15:18:24 2020 +0800

    tools/checkpatch.sh: enhance added files judgement with +++ at the line beginning
    
    In https://github.com/apache/incubator-nuttx-apps/pull/179, there is a
    removed graphics/littlevgl/lv_symbol_def.patch file whose content would be
    treated abnormally and results in errors.
    
    Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
---
 tools/checkpatch.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh
index 3fbc559..18a9848 100755
--- a/tools/checkpatch.sh
+++ b/tools/checkpatch.sh
@@ -56,7 +56,7 @@ check_file() {
 
 check_ranges() {
   while read; do
-    if [[ $REPLY =~ \+\+\+\ (b/)?([^[:blank:]]+).* ]]; then
+    if [[ $REPLY =~ ^(\+\+\+\ (b/)?([^[:blank:]]+).*)$ ]]; then
       if [ "$ranges" != "" ]; then
         if [ $range != 0 ]; then
           check_file $ranges $path 2>&1
@@ -64,7 +64,7 @@ check_ranges() {
           check_file $path 2>&1
         fi
       fi
-      path=${BASH_REMATCH[2]}
+      path=${BASH_REMATCH[3]}
       ranges=""
     elif [[ $REPLY =~ @@\ -[0-9]+(,[0-9]+)?\ \+([0-9]+,[0-9]+)?\ @@.* ]]; then
       ranges+="-r ${BASH_REMATCH[2]} "


Mime
View raw message