diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 16:29:38 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 16:29:38 +0000 |
commit | 7c7d34a16f08f84427b3f617313d9633423ad5eb (patch) | |
tree | 2c1ac6a7e6b47a49228b905f12b3604dfa4d1dc3 /hurd/get-host.c | |
parent | 6772d640a4f4874166a61f1859e1660a2913a89d (diff) | |
parent | 963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff) |
Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixes
Diffstat (limited to 'hurd/get-host.c')
-rw-r--r-- | hurd/get-host.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hurd/get-host.c b/hurd/get-host.c index a76ba5c095..2001fc5a86 100644 --- a/hurd/get-host.c +++ b/hurd/get-host.c @@ -1,5 +1,5 @@ /* Get a host configuration item kept as the whole contents of a file. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -65,7 +65,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen) } /* If the file is empty, give an empty value. */ - if (nread == 0) + if (nread == 0 && more == 0) { if (buflen != 0) *buf = '\0'; @@ -80,7 +80,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen) if (nread < buflen) buf[nread] = '\0'; else - if (buf[nread - 1] != '\0') + if (nread != 0 && buf[nread - 1] != '\0') more = 1; if (more) |