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

Diff for /src/usr.bin/look/look.c between version 1.5 and 1.6

version 1.5, 2000/10/12 10:01:18 version 1.6, 2001/11/19 19:02:15
Line 158 
Line 158 
 look(string, front, back)  look(string, front, back)
         char *string, *front, *back;          char *string, *front, *back;
 {  {
         register int ch;          int ch;
         register char *readp, *writep;          char *readp, *writep;
   
         /* Reformat string string to avoid doing it multiple times later. */          /* Reformat string string to avoid doing it multiple times later. */
         for (readp = writep = string; ch = *readp++;) {          for (readp = writep = string; ch = *readp++;) {
Line 224 
Line 224 
   
 char *  char *
 binary_search(string, front, back)  binary_search(string, front, back)
         register char *string, *front, *back;          char *string, *front, *back;
 {  {
         register char *p;          char *p;
   
         p = front + (back - front) / 2;          p = front + (back - front) / 2;
         SKIP_PAST_NEWLINE(p, back);          SKIP_PAST_NEWLINE(p, back);
Line 282 
Line 282 
  */   */
 void  void
 print_from(string, front, back)  print_from(string, front, back)
         register char *string, *front, *back;          char *string, *front, *back;
 {  {
         for (; front < back && compare(string, front, back) == EQUAL; ++front) {          for (; front < back && compare(string, front, back) == EQUAL; ++front) {
                 for (; front < back && *front != '\n'; ++front)                  for (; front < back && *front != '\n'; ++front)
Line 308 
Line 308 
  */   */
 int  int
 compare(s1, s2, back)  compare(s1, s2, back)
         register char *s1, *s2, *back;          char *s1, *s2, *back;
 {  {
         register int ch;          int ch;
   
         for (; *s1 && s2 < back && *s2 != '\n'; ++s1, ++s2) {          for (; *s1 && s2 < back && *s2 != '\n'; ++s1, ++s2) {
                 ch = *s2;                  ch = *s2;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6