aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2007-10-05 07:36:51 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2007-10-05 07:36:51 +0000
commit207837b284dafc95cc5783494fc77669e8e87f44 (patch)
tree38dd412713700e79d6aaaae8d85282d5112f8b28 /tools
parentfeb0330f2d2cfe3b5e8b3301acb4fa9530a4e014 (diff)
do not prepend './' before input file name if -D <dir> option is not used
it made problem with absolute path usage svn path=/trunk/; revision=23068
Diffstat (limited to 'tools')
-rwxr-xr-xtools/asn2wrs.py7
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()