[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#9762: tac fails when given multiple non-seekable inputs due to misus
From: |
Paul Eggert |
Subject: |
bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp() |
Date: |
Mon, 17 Oct 2011 10:24:19 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Thunderbird/3.1.15 |
On 10/17/11 08:18, Jim Meyering wrote:
>> + char const * const Template = "tacXXXXXX";
That "const * const" prompted me to suggest a minor
improvement. Since Template's address is never taken,
better would be
char const Template[] = "tacXXXXXX";
Hmm, or better yet, get rid of Template entirely:
--- a/src/tac.c
+++ b/src/tac.c
@@ -430,12 +430,11 @@ copy_to_temp (FILE **g_tmp, char **g_tempfile, int
input_fd, char const *file)
if (template == NULL)
{
- char const * const Template = "tacXXXXXX";
tempdir = getenv ("TMPDIR");
if (tempdir == NULL)
tempdir = DEFAULT_TMPDIR;
- template = file_name_concat (tempdir, Template, NULL);
+ template = file_name_concat (tempdir, "tacXXXXXX", NULL);
}
/* FIXME: there's a small window between a successful mkstemp call
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), (continued)
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Erik Auerswald, 2011/10/15
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/16
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/16
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/17
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/17
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Ambrose Feinstein, 2011/10/17
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/18
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Paul Eggert, 2011/10/18
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/18
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/19
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(),
Paul Eggert <=
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/17
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Jim Meyering, 2011/10/18
- bug#9762: tac fails when given multiple non-seekable inputs due to misuse of mkstemp(), Paul Eggert, 2011/10/18