aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorDavid Malone <dwmalone@FreeBSD.org>2002-04-10 22:01:37 +0000
committerDavid Malone <dwmalone@FreeBSD.org>2002-04-10 22:01:37 +0000
commit879e98b647d64728fc5c86f64f999077def7259d (patch)
tree6a1b896984eaa41d8a8ca696f933ef18f3ec64f6 /usr.sbin
parenta983fdfe4c88909d91f467051e84e0d3a7c3723a (diff)
downloadsrc-879e98b647d64728fc5c86f64f999077def7259d.tar.gz
src-879e98b647d64728fc5c86f64f999077def7259d.zip
Only remove the '\n' at the end of a line if there is one.
I missed this as part of the fix to the PR below. PR: 31265 Submitted by: Matthew D. Fuller <fullermd@over-yonder.net> MFC after: 1 week
Notes
Notes: svn path=/head/; revision=94389
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/cron/lib/misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/cron/lib/misc.c b/usr.sbin/cron/lib/misc.c
index f8538ea3f346..195ff9cb2da1 100644
--- a/usr.sbin/cron/lib/misc.c
+++ b/usr.sbin/cron/lib/misc.c
@@ -392,7 +392,8 @@ in_file(string, file)
rewind(file);
while (fgets(line, MAX_TEMPSTR, file)) {
if (line[0] != '\0')
- line[strlen(line)-1] = '\0';
+ if (line[strlen(line)-1] == '\n')
+ line[strlen(line)-1] = '\0';
if (0 == strcmp(line, string))
return TRUE;
}