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
2207ff5d
Commit
2207ff5d
authored
Dec 06, 2016
by
DJ Delorie
Committed by
DJ Delorie
Dec 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* argv.c (expandargv): Check for directories passed as @-files.
From-SVN: r243280
parent
202687fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
libiberty/ChangeLog
+4
-0
libiberty/argv.c
+19
-0
No files found.
libiberty/ChangeLog
View file @
2207ff5d
2016-11-30 DJ Delorie <dj@redhat.com>
* argv.c (expandargv): Check for directories passed as @-files.
2016-11-30 David Malcolm <dmalcolm@redhat.com>
PR c/78498
...
...
libiberty/argv.c
View file @
2207ff5d
...
...
@@ -35,6 +35,13 @@ Boston, MA 02110-1301, USA. */
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifndef NULL
#define NULL 0
...
...
@@ -387,6 +394,9 @@ expandargv (int *argcp, char ***argvp)
char
**
file_argv
;
/* The number of options read from the response file, if any. */
size_t
file_argc
;
#ifdef S_ISDIR
struct
stat
sb
;
#endif
/* We are only interested in options of the form "@file". */
filename
=
(
*
argvp
)[
i
];
if
(
filename
[
0
]
!=
'@'
)
...
...
@@ -397,6 +407,15 @@ expandargv (int *argcp, char ***argvp)
fprintf
(
stderr
,
"%s: error: too many @-files encountered
\n
"
,
(
*
argvp
)[
0
]);
xexit
(
1
);
}
#ifdef S_ISDIR
if
(
stat
(
filename
+
1
,
&
sb
)
<
0
)
continue
;
if
(
S_ISDIR
(
sb
.
st_mode
))
{
fprintf
(
stderr
,
"%s: error: @-file refers to a directory
\n
"
,
(
*
argvp
)[
0
]);
xexit
(
1
);
}
#endif
/* Read the contents of the file. */
f
=
fopen
(
++
filename
,
"r"
);
if
(
!
f
)
...
...
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