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

Diff for /src/usr.bin/less/filename.c between version 1.24 and 1.25

version 1.24, 2016/03/16 15:36:26 version 1.25, 2016/09/17 15:06:41
Line 125 
Line 125 
          * Determine how big a string we need to allocate.           * Determine how big a string we need to allocate.
          */           */
         len = 1; /* Trailing null byte */          len = 1; /* Trailing null byte */
         for (p = s;  *p != '\0';  p++) {          for (p = s; *p != '\0'; p++) {
                 len++;                  len++;
                 if (*p == openquote || *p == closequote)                  if (*p == openquote || *p == closequote)
                         have_quotes = 1;                          have_quotes = 1;
Line 233 
Line 233 
          * need to allocate for the expanded string.           * need to allocate for the expanded string.
          */           */
         n = 0;          n = 0;
         for (fr = s;  *fr != '\0';  fr++) {          for (fr = s; *fr != '\0'; fr++) {
                 switch (*fr) {                  switch (*fr) {
                 case '%':                  case '%':
                 case '#':                  case '#':
Line 270 
Line 270 
          * Now copy the string, expanding any "%" or "#".           * Now copy the string, expanding any "%" or "#".
          */           */
         to = e;          to = e;
         for (fr = s;  *fr != '\0';  fr++) {          for (fr = s; *fr != '\0'; fr++) {
                 switch (*fr) {                  switch (*fr) {
                 case '%':                  case '%':
                 case '#':                  case '#':
Line 762 
Line 762 
 {  {
         char *slash;          char *slash;
   
         for (slash = name + strlen(name);  slash > name; ) {          for (slash = name + strlen(name); slash > name; ) {
                 --slash;                  --slash;
                 if (*slash == '/')                  if (*slash == '/')
                         return (slash + 1);                          return (slash + 1);

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25