Module Name:    src
Committed By:   christos
Date:           Thu Dec 17 22:36:48 UTC 2015

Modified Files:
        src/external/bsd/cron/dist: do_command.c funcs.h misc.c

Log Message:
I am having the last_word: Print the full hostname.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/cron/dist/do_command.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/cron/dist/funcs.h \
    src/external/bsd/cron/dist/misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/cron/dist/do_command.c
diff -u src/external/bsd/cron/dist/do_command.c:1.6 src/external/bsd/cron/dist/do_command.c:1.7
--- src/external/bsd/cron/dist/do_command.c:1.6	Fri Sep  5 17:32:37 2014
+++ src/external/bsd/cron/dist/do_command.c	Thu Dec 17 17:36:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: do_command.c,v 1.6 2014/09/05 21:32:37 christos Exp $	*/
+/*	$NetBSD: do_command.c,v 1.7 2015/12/17 22:36:48 christos Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = "Id: do_command.c,v 1.9 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: do_command.c,v 1.6 2014/09/05 21:32:37 christos Exp $");
+__RCSID("$NetBSD: do_command.c,v 1.7 2015/12/17 22:36:48 christos Exp $");
 #endif
 #endif
 
@@ -454,7 +454,7 @@ child_process(entry *e) {
 				(void)fprintf(mail, "To: %s\n", mailto);
 				(void)fprintf(mail,
 				    "Subject: Cron <%s@%s> %s\n",
-				    usernm, first_word(hostname, "."), e->cmd);
+				    usernm, hostname, e->cmd);
 				(void)fprintf(mail,
 				    "Auto-Submitted: auto-generated\n");
 #ifdef MAIL_DATE

Index: src/external/bsd/cron/dist/funcs.h
diff -u src/external/bsd/cron/dist/funcs.h:1.2 src/external/bsd/cron/dist/funcs.h:1.3
--- src/external/bsd/cron/dist/funcs.h:1.2	Thu May  6 14:53:17 2010
+++ src/external/bsd/cron/dist/funcs.h	Thu Dec 17 17:36:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: funcs.h,v 1.2 2010/05/06 18:53:17 christos Exp $	*/
+/*	$NetBSD: funcs.h,v 1.3 2015/12/17 22:36:48 christos Exp $	*/
 
 /*
  * Id: funcs.h,v 1.9 2004/01/23 18:56:42 vixie Exp
@@ -59,7 +59,6 @@ size_t		strlens(const char *, ...);
 char		*env_get(const char *, char **),
 		*arpadate(time_t *),
 		*mkprints(char *, size_t),
-		*first_word(char *, const char *),
 		**env_init(void),
 		**env_copy(char **),
 		**env_set(char **, char *);
Index: src/external/bsd/cron/dist/misc.c
diff -u src/external/bsd/cron/dist/misc.c:1.2 src/external/bsd/cron/dist/misc.c:1.3
--- src/external/bsd/cron/dist/misc.c:1.2	Thu May  6 14:53:17 2010
+++ src/external/bsd/cron/dist/misc.c	Thu Dec 17 17:36:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.2 2010/05/06 18:53:17 christos Exp $	*/
+/*	$NetBSD: misc.c,v 1.3 2015/12/17 22:36:48 christos Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = "Id: misc.c,v 1.16 2004/01/23 18:56:43 vixie Exp";
 #else
-__RCSID("$NetBSD: misc.c,v 1.2 2010/05/06 18:53:17 christos Exp $");
+__RCSID("$NetBSD: misc.c,v 1.3 2015/12/17 22:36:48 christos Exp $");
 #endif
 #endif
 
@@ -497,41 +497,6 @@ log_close(void) {
 #endif /*SYSLOG*/
 }
 
-/* char *first_word(char *s, char *t)
- *	return pointer to first word
- * parameters:
- *	s - string we want the first word of
- *	t - terminators, implicitly including \0
- * warnings:
- *	(1) this routine is fairly slow
- *	(2) it returns a pointer to static storage
- */
-char *
-first_word(char *s, const char *t) {
-	static char retbuf[2][MAX_TEMPSTR + 1];	/* sure wish C had GC */
-	static int retsel = 0;
-	char *rb, *rp;
-
-	/* select a return buffer */
-	retsel = 1-retsel;
-	rb = &retbuf[retsel][0];
-	rp = rb;
-
-	/* skip any leading terminators */
-	while (*s && (NULL != strchr(t, *s))) {
-		s++;
-	}
-
-	/* copy until next terminator or full buffer */
-	while (*s && (NULL == strchr(t, *s)) && (rp < &rb[MAX_TEMPSTR])) {
-		*rp++ = *s++;
-	}
-
-	/* finish the return-string and return it */
-	*rp = '\0';
-	return (rb);
-}
-
 /* warning:
  *	heavily ascii-dependent.
  */

Reply via email to