From 31a2863c1a9a5e8960c6a61a0b26e6c1a3d3b0f7 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Mon, 11 Jan 2010 11:05:11 +0100 Subject: Fixed NAR-128 --- README.txt | 1 + .../net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.txt b/README.txt index b3d53b4..0a96d88 100644 --- a/README.txt +++ b/README.txt @@ -10,6 +10,7 @@ Modified version of ant contrib cpptasks, used in the freehep/maven-nar-plugin. - added .f90 as extension for the fortran compiler, see NAR-108 - merged with cpptasks-1.0b5.tar.gz - See NAR-103 for tests that have been changed +- [src/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker] throw buildException when absolute paths are too long, Windows only. * cpptasks-1.0-beta-4-parallel-5 diff --git a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java index d167823..92d06ea 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java @@ -336,9 +336,10 @@ public abstract class CommandLineLinker extends AbstractLinker */ protected String prepareFilename(StringBuffer buf, String outputDir, String sourceFile) { -// FREEHEP BEGIN return relatuve path if absolute path is too long - if (isWindows() && sourceFile.length() > 250) { - sourceFile = CUtil.getRelativePath(outputDir, new File(sourceFile)); +// FREEHEP BEGIN exit if absolute path is too long. Max length on relative paths in windows is even shorter. + int maxPathLength = 250; + if (isWindows() && sourceFile.length() > maxPathLength) { + throw new BuildException("Absolute path too long, "+sourceFile.length()+" > "+maxPathLength+": '"+sourceFile); } // FREEHEP END return quoteFilename(buf, sourceFile); -- cgit v1.2.3