From 7713a0580ffd38602449546f743c4eaccdeff06d Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Thu, 25 Feb 2021 10:19:00 +0000 Subject: 13582 wsdiff does not like non-proto directories Reviewed by: Toomas Soome Reviewed by: Rich Lowe Approved by: Robert Mustacchi --- usr/src/tools/scripts/wsdiff.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/src/tools/scripts/wsdiff.py') diff --git a/usr/src/tools/scripts/wsdiff.py b/usr/src/tools/scripts/wsdiff.py index 259f2005fb..6ca296d3df 100644 --- a/usr/src/tools/scripts/wsdiff.py +++ b/usr/src/tools/scripts/wsdiff.py @@ -303,10 +303,12 @@ def str_prefix_trunc(s, prefix) : def fnFormat(fn) : global baseWsRoot, ptchWsRoot - if len(os.path.commonprefix([fn, baseWsRoot])) == len(baseWsRoot): + if (baseWsRoot and + len(os.path.commonprefix([fn, baseWsRoot])) == len(baseWsRoot)): return fn[len(baseWsRoot) + 1:] - if len(os.path.commonprefix([fn, ptchWsRoot])) == len(ptchWsRoot): + if (ptchWsRoot and + len(os.path.commonprefix([fn, ptchWsRoot])) == len(ptchWsRoot)): return fn[len(ptchWsRoot) + 1:] # Fall back to looking for the expected root_[-nd] string -- cgit v1.2.3