=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/lesskey.c,v retrieving revision 1.1.1.3 retrieving revision 1.1.1.4 diff -u -r1.1.1.3 -r1.1.1.4 --- src/usr.bin/less/lesskey.c 2011/09/16 17:47:06 1.1.1.3 +++ src/usr.bin/less/lesskey.c 2014/04/25 13:33:48 1.1.1.4 @@ -1,11 +1,10 @@ /* - * Copyright (C) 1984-2011 Mark Nudelman + * Copyright (C) 1984-2012 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. * - * For more information about less, or for information on how to - * contact the author, see the README file. + * For more information, see the README file. */ @@ -112,6 +111,7 @@ { "flush-repaint", A_FREPAINT }, { "forw-bracket", A_F_BRACKET }, { "forw-forever", A_F_FOREVER }, + { "forw-until-hilite", A_F_UNTIL_HILITE }, { "forw-line", A_F_LINE }, { "forw-line-force", A_FF_LINE }, { "forw-screen", A_F_SCREEN }, @@ -227,11 +227,13 @@ char *filename; { char *pathname; + size_t len; - pathname = calloc(strlen(dirname) + strlen(filename) + 2, sizeof(char)); - strcpy(pathname, dirname); - strcat(pathname, PATHNAME_SEP); - strcat(pathname, filename); + len = strlen(dirname) + strlen(filename) + 2; + pathname = calloc(len, sizeof(char)); + strlcpy(pathname, dirname, len); + strlcat(pathname, PATHNAME_SEP, len); + strlcat(pathname, filename, len); return (pathname); } @@ -449,7 +451,7 @@ } case '^': /* - * Carat means CONTROL. + * Caret means CONTROL. */ *pp = p+2; buf[0] = CONTROL(p[1]); @@ -783,11 +785,11 @@ char *path = getenv("HOMEPATH"); if (drive != NULL && path != NULL) { - char *env = (char *) calloc(strlen(drive) + - strlen(path) + 6, sizeof(char)); - strcpy(env, "HOME="); - strcat(env, drive); - strcat(env, path); + size_t len = strlen(drive) + strlen(path) + 6; + char *env = (char *) calloc(len, sizeof(char)); + strlcpy(env, "HOME=", len); + strlcat(env, drive, len); + strlcat(env, path, len); putenv(env); } }