mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
Fixed a CR/LF problem on Windows
This commit is contained in:
parent
af500f0ae4
commit
13acd78a39
@ -1,3 +1,7 @@
|
|||||||
|
2011-01-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* trustlist.c (read_one_trustfile): Also chop an CR.
|
||||||
|
|
||||||
2010-12-02 Werner Koch <wk@g10code.com>
|
2010-12-02 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* gpg-agent.c (CHECK_OWN_SOCKET_INTERVAL) [W32CE]: Set to 60
|
* gpg-agent.c (CHECK_OWN_SOCKET_INTERVAL) [W32CE]: Set to 60
|
||||||
|
@ -139,8 +139,9 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
while (es_fgets (line, DIM(line)-1, fp))
|
while (es_fgets (line, DIM(line)-1, fp))
|
||||||
{
|
{
|
||||||
lnr++;
|
lnr++;
|
||||||
|
|
||||||
if (!*line || line[strlen(line)-1] != '\n')
|
n = strlen (line);
|
||||||
|
if (!n || line[n-1] != '\n')
|
||||||
{
|
{
|
||||||
/* Eat until end of line. */
|
/* Eat until end of line. */
|
||||||
while ( (c=es_getc (fp)) != EOF && c != '\n')
|
while ( (c=es_getc (fp)) != EOF && c != '\n')
|
||||||
@ -151,7 +152,9 @@ read_one_trustfile (const char *fname, int allow_include,
|
|||||||
fname, lnr, gpg_strerror (err));
|
fname, lnr, gpg_strerror (err));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
line[strlen(line)-1] = 0; /* Chop the LF. */
|
line[--n] = 0; /* Chop the LF. */
|
||||||
|
if (n && line[n-1] == '\r')
|
||||||
|
line[--n] = 0; /* Chop an optional CR. */
|
||||||
|
|
||||||
/* Allow for empty lines and spaces */
|
/* Allow for empty lines and spaces */
|
||||||
for (p=line; spacep (p); p++)
|
for (p=line; spacep (p); p++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user