Ethereal-dev: [Ethereal-dev] patch for idl2eth

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Frank Singleton <frank.singleton@xxxxxxxxxxxx>
Date: Thu, 30 Aug 2001 10:25:22 -0500
Hi,

Here is a small patch for ethereal_be.py (part of idl2eth) :

- Use only basename of CORBA IDL file to generate the dissector
  name, and not the fullpath name. Allows idl2eth to generate
  valid "C" code no matter where the IDL file lives (doh!)

twas diffed against the 2001-08-29 nightly tarball.

Cheers / Frank..

-- 
EUS/SV/Z Frank Singleton      ASO Americas BSS
Office : +1 972 583 3251      ECN 800 33251  
Mobile : +1 214 228 0874      Amateur Radio: VK3FCS/KM5WS   
Email : frank.singleton@xxxxxxxxxxxx

Hardware: HP Omnibook 4150 running Redhat Linux 7.1 (2.4.3-12 kernel).
--- ethereal_be.py	2001/08/29 16:48:29	1.1
+++ ethereal_be.py	2001/08/30 14:55:41	1.4
@@ -1,6 +1,6 @@
 # -*- python -*-
 #
-# $Id: ethereal_be.py,v 1.1 2001/08/29 16:48:29 frank Exp $
+# $Id: ethereal_be.py,v 1.4 2001/08/30 14:55:41 frank Exp $
 #
 #    File      : ethereal_be.py
 #
@@ -59,6 +59,7 @@
 
 from omniidl import idlast, idltype, idlvisitor, idlutil, output
 import sys, string
+from os import path
 from ethereal_gen import ethereal_gen_C
 
 #
@@ -139,7 +140,8 @@
     # Assumption: Name is of the form   abcdefg.xyz  (eg: CosNaming.idl)
     #
 
-    nl = string.split(tree.file(),".")[0] # split name of main IDL file using "." as separator
+    fname = path.basename(tree.file())    # grab basename only, dont care about path
+    nl = string.split(fname,".")[0]       # split name of main IDL file using "." as separator
                                           # and grab first field (eg: CosNaming)
 
     # create a C generator object