Project

General

Profile

PreprocessorHints.diff

Vladimir Tsichevski, 08/22/2022 07:01 PM

Download (1.38 KB)

View differences:

src/com/goldencode/p2j/preproc/PreprocessorHints.java 2022-08-22 22:43:20 +0000
80 80
package com.goldencode.p2j.preproc;
81 81

  
82 82
import java.io.*;
83
import java.nio.file.*;
83 84
import java.util.*;
85

  
84 86
import org.w3c.dom.*;
85
import com.goldencode.util.*;
87

  
86 88
import com.goldencode.p2j.cfg.*;
87 89
import com.goldencode.p2j.util.*;
90
import com.goldencode.util.*;
88 91

  
89 92
/**
90 93
 * Loads hints information from a preprocessor hints XML file into memory and
......
1120 1123
      int eline = Integer.parseInt(elin);
1121 1124
      int ecolm = Integer.parseInt(ecol);
1122 1125

  
1123
      // denormalize the file
1124
      try
1125
      {
1126
         String home = Configuration.home() + File.separator; 
1127
         file = home + file;
1128
      }
1129
      catch (ConfigurationException xcpt)
1130
      {
1131
         throw new PreprocessorException("Project home misconfigured", xcpt);
1126
      if (!Paths.get(file).isAbsolute())
1127
      {
1128
         // denormalize the file
1129
         try
1130
         {
1131
            file = Paths.get(Configuration.home(), file).toString();
1132
         }
1133
         catch (ConfigurationException xcpt)
1134
         {
1135
            throw new PreprocessorException("Project home misconfigured", xcpt);
1136
         }   
1132 1137
      }
1133 1138

  
1134 1139
      // create instance of IncludeHint