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

Diff for /src/usr.bin/man/Attic/man.c between version 1.30 and 1.31

version 1.30, 2005/10/31 10:38:04 version 1.31, 2005/11/12 00:51:13
Line 680 
Line 680 
 check_pager(char *name)  check_pager(char *name)
 {  {
         char *p, *save;          char *p, *save;
         int len;  
   
         /*          /*
          * if the user uses "more", we make it "more -s"; watch out for           * if the user uses "more", we make it "more -s"; watch out for
Line 697 
Line 696 
         if (!strncmp(p, "more", 4) && (p[4] == '\0' || isspace(p[4]))){          if (!strncmp(p, "more", 4) && (p[4] == '\0' || isspace(p[4]))){
                 save = name;                  save = name;
                 /* allocate space to add the "-s" */                  /* allocate space to add the "-s" */
                 len = strlen(save) + 1 + sizeof("-s");                  if (asprintf(&name, "%s -s", save) == -1)
                 if ((name = malloc(len)) == NULL)                          err(1, "asprintf");
                         err(1, NULL);  
                 (void)snprintf(name, len, "%s %s", save, "-s");  
         }          }
         return(name);          return(name);
 }  }

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31