Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
50a2de96
Commit
50a2de96
authored
Jun 29, 2004
by
Danny Smith
Committed by
Danny Smith
Jun 29, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lrealpath.c (lrealpath): Add _WIN32 support.
From-SVN: r83853
parent
fe88415f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
libiberty/ChangeLog
+4
-0
libiberty/lrealpath.c
+30
-0
No files found.
libiberty/ChangeLog
View file @
50a2de96
2004-06-29 Danny Smith <dannysmith@users.sourceforge.net>
* lrealpath.c (lrealpath): Add _WIN32 support.
2004-06-28 Zack Weinberg <zack@codesourcery.com>
2004-06-28 Zack Weinberg <zack@codesourcery.com>
* cp-demangle.h: Declare cplus_demangle_operators,
* cp-demangle.h: Declare cplus_demangle_operators,
...
...
libiberty/lrealpath.c
View file @
50a2de96
...
@@ -64,6 +64,12 @@ extern char *canonicalize_file_name (const char *);
...
@@ -64,6 +64,12 @@ extern char *canonicalize_file_name (const char *);
# define REALPATH_LIMIT MAXPATHLEN
# define REALPATH_LIMIT MAXPATHLEN
# endif
# endif
# endif
# endif
#else
/* cygwin has realpath, so it won't get here. */
# if defined (_WIN32)
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
/* for GetFullPathName */
# endif
#endif
#endif
char
*
char
*
...
@@ -123,6 +129,30 @@ lrealpath (filename)
...
@@ -123,6 +129,30 @@ lrealpath (filename)
}
}
#endif
#endif
/* The MS Windows method. If we don't have realpath, we assume we
don't have symlinks and just canonicalize to a Windows absolute
path. GetFullPath converts ../ and ./ in relative paths to
absolute paths, filling in current drive if one is not given
or using the current directory of a specified drive (eg, "E:foo").
It also converts all forward slashes to back slashes. */
#if defined (_WIN32)
{
char
buf
[
MAX_PATH
];
char
*
basename
;
DWORD
len
=
GetFullPathName
(
filename
,
MAX_PATH
,
buf
,
&
basename
);
if
(
len
==
0
||
len
>
MAX_PATH
-
1
)
return
strdup
(
filename
);
else
{
/* The file system is case-preserving but case-insensitive,
Canonicalize to lowercase, using the codepage associated
with the process locale. */
CharLowerBuff
(
buf
,
len
);
return
strdup
(
buf
);
}
}
#endif
/* This system is a lost cause, just duplicate the filename. */
/* This system is a lost cause, just duplicate the filename. */
return
strdup
(
filename
);
return
strdup
(
filename
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment