diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2014-02-03 12:19:58 +0100 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2014-02-04 08:17:54 +0000 |
commit | 4e7e5a63c3667422f93ee4b6ebb49ef5b7b51a82 (patch) | |
tree | 9ce8c19076f0e672b84c6dc5b59a7ed6d90797f3 /tools/asn2wrs.py | |
parent | 28e028ddd5579c3d405b21523cdc2773c798e32f (diff) |
asn2wrs: Rewrite relative paths in header.
Change both absolute paths and relative paths generated outside
source directory to paths relative to asn1/<proto> subdir.
Change-Id: I867d3a31c687b08347b11336ce69fc70db2d7c7b
Reviewed-on: https://code.wireshark.org/review/88
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'tools/asn2wrs.py')
-rwxr-xr-x | tools/asn2wrs.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index 0b61245f6c..dc89169265 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -2940,9 +2940,10 @@ class EthOut: out += '\n' # Make Windows path separator look like Unix path separator out = out.replace('\\', '/') - # Change abolute paths to paths relative to asn1/<proto> subdir - out = re.sub(r'(\s)/\S*(/tools/|/epan/)', r'\1../..\2', out) - out = re.sub(r'(\s)/\S*/asn1/\S*?([\s/])', r'\1.\2', out) + # Change absolute paths and relative paths generated outside + # source directory to paths relative to asn1/<proto> subdir. + out = re.sub(r'(\s)[./]\S*(/tools/|/epan/)', r'\1../..\2', out) + out = re.sub(r'(\s)[./]\S*/asn1/\S*?([\s/])', r'\1.\2', out) return out #--- dbg_print ------------------------------------------------------- |