summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2007-10-11 14:48:12 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2007-10-11 14:48:12 +0000
commite6290e8edcbb177d0a782678428ac89507da1735 (patch)
treef34dcce524381df726182e6c30d9d5ccec7d26e2 /tools
parent0e0bed500d402831a05232e3c980218c42aa1967 (diff)
downloadwireshark-e6290e8edcbb177d0a782678428ac89507da1735.tar.gz
put only file basename into #line directives
svn path=/trunk/; revision=23146
Diffstat (limited to 'tools')
-rwxr-xr-xtools/asn2wrs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py
index 3d12e8bafb..6beb8638dd 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -2110,7 +2110,7 @@ class EthCnf:
self.fn[name][ctx]['used'] = True
out = self.fn[name][ctx]['text']
if (not self.suppress_line):
- out = '#line %u "%s"\n%s\n' % (self.fn[name][ctx]['lineno'], self.fn[name][ctx]['fn'], out);
+ out = '#line %u "%s"\n%s\n' % (self.fn[name][ctx]['lineno'], os.path.basename(self.fn[name][ctx]['fn']), out);
return out
def add_pdu(self, par, is_new, fn, lineno):
@@ -2778,7 +2778,7 @@ class EthOut:
fout.write(self.fhdr(out_nm))
fout.write('/* Input file: ' + in_nm +' */\n')
fout.write('\n')
- fout.write('#line 1 "%s"\n' % (in_nm))
+ fout.write('#line %u "%s"\n' % (1, os.path.basename(in_nm)))
include = re.compile(r'^\s*#\s*include\s+[<"](?P<fname>[^>"]+)[>"]', re.IGNORECASE)
@@ -2800,12 +2800,12 @@ class EthOut:
if (ifile):
fout.write('\n')
fout.write('/*--- Included file: ' + ifile + ' ---*/\n')
- fout.write('#line 1 "' + ifile + '"\n')
+ fout.write('#line %u "%s"\n' % (1, os.path.basename(ifile)))
finc = file(ifile, "r")
fout.write(finc.read())
fout.write('\n')
fout.write('/*--- End of included file: ' + ifile + ' ---*/\n')
- fout.write('#line %i "%s"\n' % (cont_linenum+1,in_nm) )
+ fout.write('#line %u "%s"\n' % (cont_linenum+1, os.path.basename(in_nm)) )
finc.close()
else:
fout.write(line)