aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/unit.c
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2014-05-22 06:51:25 +0300
committerJanne Blomqvist <jb@gcc.gnu.org>2014-05-22 06:51:25 +0300
commit4269f19c09163d6ef65043171eeccc9c521d9b5f (patch)
treeb97492f2a8d9b9b3d41f020dde39ac89bad83229 /libgfortran/io/unit.c
parentd5c67efda0d5e2d42abd49c0d58bb39a038d20ec (diff)
downloadgcc-4269f19c09163d6ef65043171eeccc9c521d9b5f.zip
gcc-4269f19c09163d6ef65043171eeccc9c521d9b5f.tar.gz
gcc-4269f19c09163d6ef65043171eeccc9c521d9b5f.tar.bz2
PR 60324 Handle long path names, don't use PATH_MAX.
From-SVN: r210738
Diffstat (limited to 'libgfortran/io/unit.c')
-rw-r--r--libgfortran/io/unit.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c
index 385818a..a406c9e 100644
--- a/libgfortran/io/unit.c
+++ b/libgfortran/io/unit.c
@@ -786,7 +786,6 @@ unit_truncate (gfc_unit * u, gfc_offset pos, st_parameter_common * common)
char *
filename_from_unit (int n)
{
- char *filename;
gfc_unit *u;
int c;
@@ -805,11 +804,7 @@ filename_from_unit (int n)
/* Get the filename. */
if (u != NULL)
- {
- filename = (char *) xmalloc (u->file_len + 1);
- unpack_filename (filename, u->file, u->file_len);
- return filename;
- }
+ return fc_strdup (u->file, u->file_len);
else
return (char *) NULL;
}