------------------------------------------------------------ revno: 12289 revision-id: kinkie@squid-cache.org-20120815145811-237orwvzoenrr0n8 parent: squid3@treenet.co.nz-20120815111828-kpsn034qf61z4bn6 committer: Francesco Chemolli branch nick: trunk timestamp: Wed 2012-08-15 16:58:11 +0200 message: Make mk-globals-c.awk more permissive on the input it accepts ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: kinkie@squid-cache.org-20120815145811-237orwvzoenrr0n8 # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: dd6ad28aa70b7e7ccc799a3c4345c5adfdf0827a # timestamp: 2012-08-15 15:51:40 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20120815111828-\ # kpsn034qf61z4bn6 # # Begin patch === modified file 'src/mk-globals-c.awk' --- src/mk-globals-c.awk 2006-06-18 16:05:53 +0000 +++ src/mk-globals-c.awk 2012-08-15 14:58:11 +0000 @@ -22,12 +22,14 @@ # Check exactly for lines beginning with " extern", generated # from astyle (grrrrr ...) # -/^ extern / { # process "^extern " input lines. +/^ *extern / { # process "^extern " input lines. # 0 1 2 ####### # extern int variable; /* val */ --> int variable; /* val */ ####### ########################################################################## - len = length($0) - 11 # sub(/extern /, "") - str = substr($0, 12, len) # strip "^extern ". + pos0 = index($0,"extern") #find how much whitespeace there is + str = substr($0,pos0,length($0)) + len = length(str) - length("extern ") # sub(/extern /, "") + str = substr($0, length("extern ")+1, len) # strip "^extern ". pos0 = index(str, ";") # position of ";". pos1 = index(str, "/*") # position of "/*".