diff options
author | kukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-10-05 07:36:51 +0000 |
---|---|---|
committer | kukosa <kukosa@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-10-05 07:36:51 +0000 |
commit | 6f79741f6024d169798992727dd2aa300975aa50 (patch) | |
tree | 38dd412713700e79d6aaaae8d85282d5112f8b28 /tools | |
parent | af6943c4606c2def8a39ce0925022a001941a52b (diff) |
do not prepend './' before input file name if -D <dir> option is not used
it made problem with absolute path usage
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23068 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tools')
-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 4a7a87fccf..3d12e8bafb 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -552,7 +552,7 @@ class EthCtx: self.default_containing_variant = '_pdu_new' self.default_embedded_pdv_cb = None self.default_external_type_cb = None - self.srcdir = '.' + self.srcdir = None self.emitted_pdu = {} self.module = {} self.module_ord = [] @@ -788,7 +788,7 @@ class EthCtx: def eth_import_type(self, ident, mod, proto): #print "eth_import_type(ident='%s', mod='%s', prot='%s')" % (ident, mod, proto) if self.type.has_key(ident): - #print "already defined import=%s, module=%s" % (str(self.type[ident]['import']), self.type[ident]['module']) + #print "already defined '%s' import=%s, module=%s" % (ident, str(self.type[ident]['import']), self.type[ident].get('module', '-')) if not self.type[ident]['import'] and (self.type[ident]['module'] == mod) : return # OK - already defined elif self.type[ident]['import'] and (self.type[ident]['import'] == mod) : @@ -7460,7 +7460,8 @@ def eth_main(): for fn in args: input_file = fn lexer.lineno = 1 - f = open (ectx.srcdir + '/' + fn, "r") + if (ectx.srcdir): fn = ectx.srcdir + '/' + fn + f = open (fn, "r") ast.extend(yacc.parse(f.read(), lexer=lexer, debug=pd)) f.close () ectx.eth_clean() |