aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2014-10-26 02:43:33 +0200
committerSebastian Pipping <sebastian@pipping.org>2014-10-26 02:43:33 +0200
commit42d2b5c042631aded21e70fc0a2526ee4c99d076 (patch)
tree1972f72268ceb9cd0c040c05674fa0d77ab14ba2
parentFix crash when log files with bad names are found, only (diff)
downloadelogv-42d2b5c042631aded21e70fc0a2526ee4c99d076.tar.gz
elogv-42d2b5c042631aded21e70fc0a2526ee4c99d076.tar.bz2
elogv-42d2b5c042631aded21e70fc0a2526ee4c99d076.zip
Fix crash for PORT_LOGDIR containing ".log" (issue #4)
-rw-r--r--ChangeLog1
-rwxr-xr-xelogv2
2 files changed, 2 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 77063cc..d8645e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
0.7.6.4
* Fix crash when log files with bad names are found, only
+ * Fix crash for PORT_LOGDIR containing ".log" (issue #4)
0.7.6.3
* Prevent crash with LC_TIME=ja_JP.UTF-8 (Gentoo bug #464962)
diff --git a/elogv b/elogv
index 1eb04c4..853d404 100755
--- a/elogv
+++ b/elogv
@@ -378,7 +378,7 @@ class ElogViewer:
# then we split the string using as pattern / or : to obtain in any
# case
# ( "x11-themes", "haematite-xcursors", "1.0:20091018-195827.log")
- tmpfilepath = re.sub('\.log.*$', '.log', filepath)
+ tmpfilepath = re.sub('\\.log[^/]*$', '.log', filepath)
split_up = re.split(":|" + os.path.sep, tmpfilepath.replace(elogdir + os.path.sep, ""))
if len(split_up) < 3:
continue