Skip to content

Commit e8c0ca0

Browse files
committed
- Fix abs_path for Windows-msys.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9043 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 5eed94a commit e8c0ca0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Compiler/scripts/convert_lines.pl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use Cwd;
1010
use Cwd 'abs_path';
11-
#use File::Spec;
1211

1312
sub trim{
1413
my $string = shift;
@@ -30,8 +29,18 @@ sub trim{
3029
# regex is fun
3130
if ($trimmedLine =~ /^ *..#modelicaLine .([A-Za-z.\/]*):([0-9]*):[0-9]*-[0-9]*:[0-9]*...$/) {
3231
eval {
33-
#$inStmtFile = File::Spec->rel2abs($1); # Absolute paths makes GDB a _lot_ happier;
34-
$inStmtFile = abs_path($1); # Absolute paths makes GDB a _lot_ happier;
32+
if ($^O eq "msys") {
33+
# split the file location
34+
my @values = split('/', $1);
35+
# read the filename
36+
$fileName = pop(@values);
37+
# join the file location back
38+
$fileLocation = join('/', @values);
39+
$inStmtFile = abs_path($fileLocation); # Absolute paths makes GDB a _lot_ happier;
40+
$inStmtFile = $inStmtFile.'/'.$fileName;
41+
} else {
42+
$inStmtFile = abs_path($1); # Absolute paths makes GDB a _lot_ happier;
43+
}
3544
};
3645
if ($@) {
3746
$dir = getcwd();

0 commit comments

Comments
 (0)