blob: a784377ada5accf12564c19d763db9ce6b050598 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
--- latexrun
+++ latexrun
@@ -457,10 +457,12 @@ class Message(collections.namedtuple(
'Message', 'typ filename lineno msg')):
def emit(self):
if self.filename:
- if self.filename.startswith('./'):
- finfo = self.filename[2:]
- else:
+ cwd = os.getcwd()
+ if (os.path.isabs(self.filename) and
+ os.path.commonpath([self.filename, cwd]) != cwd):
finfo = self.filename
+ else:
+ finfo = os.path.relpath(self.filename, cwd)
else:
finfo = '<no file>'
if self.lineno is not None:
|