@joebigelow / wix-1 / commits / 1ed894bc

Use full path in source line numbers

Rob Mensching committed May 21, 2019 at 23:59 UTC 1ed894bc0f39397ec7f7f6344370fc2123420c43
1 file changed +7 -3
src/WixToolset.Core/Preprocessor.cs
+7 -3
@@ -1348,9 +1348,11 @@ namespace WixToolset.Core
1348 throw new WixException(ErrorMessages.TooDeeplyIncluded(state.Context.CurrentSourceLineNumber, state.CurrentFileStack.Count));
1349 }
1350
1351 - state.CurrentFileStack.Push(fileName);
1351 + var path = Path.GetFullPath(fileName);
1352 +
1353 + state.CurrentFileStack.Push(path);
1354 state.SourceStack.Push(state.Context.CurrentSourceLineNumber);
1353 - state.Context.CurrentSourceLineNumber = new SourceLineNumber(fileName);
1355 + state.Context.CurrentSourceLineNumber = new SourceLineNumber(path);
1356 state.IncludeNextStack.Push(true);
1357 }
1358
@@ -1468,8 +1470,10 @@ namespace WixToolset.Core
1470 {
1471 public ProcessingState(IServiceProvider serviceProvider, IPreprocessContext context)
1472 {
1473 + var path = Path.GetFullPath(context.SourcePath);
1474 +
1475 this.Context = context;
1472 - this.Context.CurrentSourceLineNumber = new SourceLineNumber(context.SourcePath);
1476 + this.Context.CurrentSourceLineNumber = new SourceLineNumber(path);
1477 this.Context.Variables = this.Context.Variables == null ? new Dictionary<string, string>() : new Dictionary<string, string>(this.Context.Variables);
1478
1479 this.Helper = serviceProvider.GetService<IPreprocessHelper>();