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

Diff for /src/usr.bin/less/cmdbuf.c between version 1.11 and 1.12

version 1.11, 2015/11/09 04:10:57 version 1.12, 2015/11/09 14:25:32
Line 918 
Line 918 
         char *word;          char *word;
         char c;          char c;
   
           free(tk_text);
           tk_text = NULL;
         /*          /*
          * Get rid of any previous tk_text.  
          */  
         if (tk_text != NULL) {  
                 free(tk_text);  
                 tk_text = NULL;  
         }  
         /*  
          * Find the original (uncompleted) word in the command buffer.           * Find the original (uncompleted) word in the command buffer.
          */           */
         word = delimit_word();          word = delimit_word();
Line 939 
Line 934 
         /*          /*
          * Save the original (uncompleted) word           * Save the original (uncompleted) word
          */           */
         if (tk_original != NULL)          free(tk_original);
                 free(tk_original);  
         tk_original = ecalloc(cp-word+1, sizeof (char));          tk_original = ecalloc(cp-word+1, sizeof (char));
         (void) strncpy(tk_original, word, cp-word);          (void) strncpy(tk_original, word, cp-word);
         /*          /*
Line 954 
Line 948 
                 tk_text = fcomplete(word);                  tk_text = fcomplete(word);
         } else {          } else {
                 char *qword = shell_quote(word+1);                  char *qword = shell_quote(word+1);
                 if (qword == NULL) {                  if (qword == NULL)
                         tk_text = fcomplete(word+1);                          tk_text = fcomplete(word+1);
                 } else {                  else
                         tk_text = fcomplete(qword);                          tk_text = fcomplete(qword);
                         free(qword);                  free(qword);
                 }  
         }          }
         *cp = c;          *cp = c;
 }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12