[BACK]Return to lesskey.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / less

Diff for /src/usr.bin/less/lesskey.c between version 1.1.1.3 and 1.1.1.4

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

Legend:
Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.4