RFR: CODETOOLS-7901088 webrev -f does not work on nawk

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Fri Nov 7 07:43:00 UTC 2014


Webrev -f does not work when using nawk, due to an incorrect substr 
based on 0 instead of 1 as index to the first position. (See prior 
discussion on webrev-dev).

Bug: https://bugs.openjdk.java.net/browse/CODETOOLS-7901088
Patch inline:

diff --git a/webrev.ksh b/webrev.ksh
--- a/webrev.ksh
+++ b/webrev.ksh
@@ -1420,7 +1420,7 @@
      # the AWK code which still tries to handle both cases
      #
      hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v 
"hgroot=$hgroot" '
-       /^\[.*\]:$/     {tree=substr($1,length(hgroot)+3); 
tree=substr(tree,0,length(tree)-2); next}
+       /^\[.*\]:$/     {tree=substr($1,length(hgroot)+3); 
tree=substr(tree,1,length(tree)-2); next}
         $1 != ""        {n=index($1,tree);
                          if (n != 1)
                                 { printf("%s/%s\n",tree,$1)}

/Magnus



More information about the code-tools-dev mailing list