aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-01 10:27:39 +0000
committerGitHub <noreply@github.com>2021-06-01 10:27:39 +0000
commit2a644a5ebb5e4b8f8dd52e5da1c87b73f2ae7f1b (patch)
treec98349b22191cca64c0715d9337cf6afa57eb2ff
parent4b13e27087a4c68824c281b2f980a7561dc39407 (diff)
parent7fb247dce4ffa6a94b229fd2ce28dbc167bbc0ec (diff)
downloadgcc-2a644a5ebb5e4b8f8dd52e5da1c87b73f2ae7f1b.zip
gcc-2a644a5ebb5e4b8f8dd52e5da1c87b73f2ae7f1b.tar.gz
gcc-2a644a5ebb5e4b8f8dd52e5da1c87b73f2ae7f1b.tar.bz2
Merge #460
460: raiifile: Allow dash-prefixed files to be parsed r=tschwinge a=CohenArthur Thanks to @tschwinge for finding the bug. I added a test case, but not a lot of programs know how to handle this file. Unless there is some specific option, `gcc` complains about no input files, and `cat` does not understand it either. So I'm not sure the test case is actually useful. Co-authored-by: CohenArthur <arthur.cohen@epita.fr>
-rw-r--r--gcc/rust/lex/rust-lex.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/lex/rust-lex.h b/gcc/rust/lex/rust-lex.h
index 8a9640e..00f9d21 100644
--- a/gcc/rust/lex/rust-lex.h
+++ b/gcc/rust/lex/rust-lex.h
@@ -18,7 +18,7 @@ private:
public:
RAIIFile (const char *filename)
{
- if (strncmp (filename, "-", 1) == 0)
+ if (strcmp (filename, "-") == 0)
file = stdin;
else
file = fopen (filename, "r");