Commit 24980272 authored by Bruce Momjian's avatar Bruce Momjian

Change awk ~ pattern from "" to //.

Remove extra backslash in pattern.  Luke Lonergan
parent 6561372c
...@@ -50,13 +50,13 @@ do ...@@ -50,13 +50,13 @@ do
if (NR >= 2) if (NR >= 2)
print line1; print line1;
if (NR >= 2 && if (NR >= 2 &&
line2 ~ "^{[ ]*$" && line2 ~ /^{[ ]*$/ &&
line1 !~ "^struct" && line1 !~ /^struct/ &&
line1 !~ "^enum" && line1 !~ /^enum/ &&
line1 !~ "^typedef" && line1 !~ /^typedef/ &&
line1 !~ "^extern[ ][ ]*\"C\"" && line1 !~ /^extern[ ][ ]*"C"/ &&
line1 !~ "=" && line1 !~ /=/ &&
line1 ~ "\)") line1 ~ /)/)
print "int pgindent_func_no_var_fix;"; print "int pgindent_func_no_var_fix;";
line1 = line2; line1 = line2;
} }
...@@ -70,8 +70,8 @@ do ...@@ -70,8 +70,8 @@ do
line2 = $0; line2 = $0;
if (skips > 0) if (skips > 0)
skips--; skips--;
if (line1 ~ "^#ifdef[ ]*__cplusplus" && if (line1 ~ /^#ifdef[ ]*__cplusplus/ &&
line2 ~ "^extern[ ]*\"C\"[ ]*$") line2 ~ /^extern[ ]*"C"[ ]*$/)
{ {
print line1; print line1;
print line2; print line2;
...@@ -81,8 +81,8 @@ do ...@@ -81,8 +81,8 @@ do
line2 = ""; line2 = "";
skips = 2; skips = 2;
} }
else if (line1 ~ "^#ifdef[ ]*__cplusplus" && else if (line1 ~ /^#ifdef[ ]*__cplusplus/ &&
line2 ~ "^}[ ]*$") line2 ~ /^}[ ]*$/)
{ {
print line1; print line1;
print "/* Close extern \"C\" */"; print "/* Close extern \"C\" */";
...@@ -1732,7 +1732,7 @@ do ...@@ -1732,7 +1732,7 @@ do
# work around misindenting of function with no variables defined # work around misindenting of function with no variables defined
awk ' awk '
{ {
if ($0 ~ "^[ ]*int[ ]*pgindent_func_no_var_fix;") if ($0 ~ /^[ ]*int[ ]*pgindent_func_no_var_fix;/)
{ {
if (getline && $0 != "") if (getline && $0 != "")
print $0; print $0;
...@@ -1751,9 +1751,9 @@ do ...@@ -1751,9 +1751,9 @@ do
# line3 = $0; # line3 = $0;
# if (skips > 0) # if (skips > 0)
# skips--; # skips--;
# if (line1 ~ " *{$" && # if (line1 ~ / *{$/ &&
# line2 ~ " *[^;{}]*;$" && # line2 ~ / *[^;{}]*;$/ &&
# line3 ~ " *}$") # line3 ~ / *}$/)
# { # {
# print line2; # print line2;
# line2 = ""; # line2 = "";
...@@ -1778,9 +1778,9 @@ do ...@@ -1778,9 +1778,9 @@ do
line3 = $0; line3 = $0;
if (skips > 0) if (skips > 0)
skips--; skips--;
if (line1 ~ " *{$" && if (line1 ~ / *{$/ &&
line2 ~ "^$" && line2 ~ /^$/ &&
line3 ~ " */\\*$") line3 ~ / *\/\*$/)
{ {
print line1; print line1;
print line3; print line3;
...@@ -1819,8 +1819,8 @@ do ...@@ -1819,8 +1819,8 @@ do
line2 = $0; line2 = $0;
if (skips > 0) if (skips > 0)
skips--; skips--;
if (line1 ~ "^$" && if (line1 ~ /^$/ &&
line2 ~ "^#endif") line2 ~ /^#endif/)
{ {
print line2; print line2;
line2 = ""; line2 = "";
...@@ -1844,7 +1844,7 @@ do ...@@ -1844,7 +1844,7 @@ do
line1 = line2; line1 = line2;
} }
END { END {
if (NR >= 1 && line2 ~ "^#endif") if (NR >= 1 && line2 ~ /^#endif/)
printf "\n"; printf "\n";
print line1; print line1;
}' | }' |
...@@ -1853,16 +1853,16 @@ do ...@@ -1853,16 +1853,16 @@ do
# like real functions. # like real functions.
awk ' BEGIN {paren_level = 0} awk ' BEGIN {paren_level = 0}
{ {
if ($0 ~ /^[a-zA-Z_][a-zA-Z_0-9]*[^\(]*$/) if ($0 ~ /^[a-zA-Z_][a-zA-Z_0-9]*[^(]*$/)
{ {
saved_len = 0; saved_len = 0;
saved_lines[++saved_len] = $0; saved_lines[++saved_len] = $0;
if ((getline saved_lines[++saved_len]) == 0) if ((getline saved_lines[++saved_len]) == 0)
print saved_lines[1]; print saved_lines[1];
else else
if (saved_lines[saved_len] !~ /^[a-zA-Z_][a-zA-Z_0-9]*\(/ || if (saved_lines[saved_len] !~ /^[a-zA-Z_][a-zA-Z_0-9]*(/ ||
saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*\(.*\)$/ || saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*(.*)$/ ||
saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*\(.*\);$/) saved_lines[saved_len] ~ /^[a-zA-Z_][a-zA-Z_0-9]*(.*);$/)
{ {
print saved_lines[1]; print saved_lines[1];
print saved_lines[2]; print saved_lines[2];
...@@ -1879,7 +1879,7 @@ do ...@@ -1879,7 +1879,7 @@ do
} }
for (i=1; i <= saved_len; i++) for (i=1; i <= saved_len; i++)
{ {
if (i == 1 && saved_lines[saved_len] ~ /\);$/) if (i == 1 && saved_lines[saved_len] ~ /);$/)
{ {
printf "%s", saved_lines[i]; printf "%s", saved_lines[i];
if (substr(saved_lines[i], length(saved_lines[i]),1) != "*") if (substr(saved_lines[i], length(saved_lines[i]),1) != "*")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment