Add ecp_nistz256.c to list of files skipped by openssl-format-source
[openssl.git] / util / openssl-format-source
index 8cf27d3af3adedc0652a6cf03d4df943d94b34ea..242c5ba81a6dab02a9c6aac8ceda6a8f4e15f676 100755 (executable)
@@ -85,9 +85,12 @@ do
       tmp=$(mktemp /tmp/indent.XXXXXX)
       trap 'rm -f "$tmp"' HUP INT TERM EXIT
 
-      case $j in 
+      case `basename $j` in 
        # the list of files that indent is unable to handle correctly
        # that we simply leave alone for manual formatting now
+       obj_dat.h|aes_core.c|aes_x86core.c|ecp_nistz256.c)
+         echo "skipping $j"
+         ;;
        *)
          if [ "$COMMENTS" = "true" ]; then
            # we have to mark single line comments as /*- ...*/ to stop indent
@@ -103,12 +106,12 @@ do
            perl -0 -np \
              -e 's/(\n#[ \t]*ifdef[ \t]+__cplusplus\n[^\n]*\n#[ \t]*endif\n)/\n\/**INDENT-OFF**\/$1\/**INDENT-ON**\/\n/g;' \
              -e 's/(\n\/\*\!)/\n\/**/g;' \
-             -e 's/(STACK_OF|LHASH_OF)\(([^ \t,\)]+)\) /$1_$2_ /g;' \
+             -e 's/(STACK_OF|LHASH_OF)\(([^ \t,\)]+)\)( |\n)/$1_$2_$3/g;' \
              | \
            perl -np \
              -e 's/^([ \t]*)\/\*([ \t]+.*)\*\/[ \t]*$/if (length("$1$2")<75) {$c="-"}else{$c=""}; "$1\/*$c$2*\/"/e;' \
              -e 's/^\/\* ((Copyright|=|----).*)$/\/*-$1/;' \
-             -e 's/^((DECLARE|IMPLEMENT)_(EXTERN_ASN1|ASN1|ADB|STACK_OF).*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
+             -e 's/^((DECLARE|IMPLEMENT)_(EXTERN_ASN1|ASN1|ADB|STACK_OF|PKCS12_STACK_OF).*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
              -e 's/^([ \t]*(make_dh|make_dh_bn|make_rfc5114_td)\(.*\)[ \t,]*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
              -e 's/^(ASN1_ADB_TEMPLATE\(.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
              -e 's/^((ASN1|ADB)_.*_END\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \
@@ -129,10 +132,10 @@ do
              > "$tmp"
          else
            expand "$j" | indent $INDENT_ARGS > "$tmp"
-         fi
+         fi;
+         mv "$tmp" "$j"
          ;;
       esac
-      mv "$tmp" "$j"
     fi
   done
 done