From ada15125a1cbb3b1718d6eef78512a36ed327fcc Mon Sep 17 00:00:00 2001 From: bebopagogo Date: Thu, 2 Jan 2020 22:15:31 -0500 Subject: [PATCH] normCast modified so only basename is conveyed for enqueued file items. Also fix to wscript for Python 3 compatibility --- examples/normCast.cpp | 10 +++++++++- wscript | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/normCast.cpp b/examples/normCast.cpp index 7ed8876..3a0b12c 100644 --- a/examples/normCast.cpp +++ b/examples/normCast.cpp @@ -331,8 +331,16 @@ bool NormCaster::StageNextTxFile() } else { - tx_pending_prefix_len = 0; + // Adjust the prefix len so only the file basename is conveyed. + // (We use a reverse ProtoTokenator tokenization to get the + // file basename string). + ProtoTokenator tk(tx_pending_path, PROTO_PATH_DELIMITER, true, 1, true); + const char* basename = tk.GetNextItem(); + ASSERT(NULL != basename); + unsigned namelen = strlen(basename); + tx_pending_prefix_len = strlen(tx_pending_path) - namelen; } + TRACE("next file staged: %s\n", tx_pending_path + tx_pending_prefix_len); return true; } else diff --git a/wscript b/wscript index 6d8f758..4d0e035 100644 --- a/wscript +++ b/wscript @@ -31,7 +31,7 @@ for line in vfile.readlines(): if "#define" == line[0] and "VERSION" == line[1]: VERSION = line[2].strip('"') if VERSION is None: - print "Warning: NORM VERSION not found!?" + print ("Warning: NORM VERSION not found!?") # So you don't need to do ./waf configure if you are just using the defaults waflib.Configure.autoconfig = True