Loading ...
Sorry, an error occurred while loading the content.

[jasspa] More search fixes

Expand Messages
  • bill@jasspa.freeserve.co.uk
    All, I ve found another problem with reverse search, the bug seems harmless enough, but it stops the new gdiff from working (it loops until you abort). Below
    Message 1 of 1 , Aug 10 4:14 PM
    • 0 Attachment
      All,

      I've found another problem with reverse search, the bug seems harmless enough,
      but it stops the new gdiff from working (it loops until you abort).

      Below is a diff of ALL the search.c changes I've made since beta 2.

      Sorry for the bugs,

      Steve
      ------------------------------------------------------------------------------
      cd C:/tmp/
      diff --context --minimal --ignore-space-change "C:/tmp/search.c.~0~" "C:/tmp/search.c"

      *** C:/tmp/search.c.~0~ Tue Aug 10 23:07:24 1999
      --- C:/tmp/search.c Tue Aug 10 23:06:44 1999
      ***************
      *** 359,369 ****
      ii = re_search_2(&mereBuffer,NULL,0,(char *) ltext(lp),jj,
      ii,jj-ii,&mereRegs,jj) ;
      }
      ! else
      {
      ii = re_search_2(&mereBuffer,NULL,0,(char *) ltext(lp),jj,
      ii-1,0-ii,&mereRegs,jj) ;
      }
      if(ii >= 0)
      {
      kk = mereRegs.end[0] ;
      --- 359,374 ----
      ii = re_search_2(&mereBuffer,NULL,0,(char *) ltext(lp),jj,
      ii,jj-ii,&mereRegs,jj) ;
      }
      ! /* special case on the first line if going backward, if ii is 0
      ! * it cannot match and we must catch this case as 0-ii == 0 == forward! */
      ! else if(ii != 0)
      {
      ii = re_search_2(&mereBuffer,NULL,0,(char *) ltext(lp),jj,
      ii-1,0-ii,&mereRegs,jj) ;
      }
      + else
      + ii = -1 ;
      +
      if(ii >= 0)
      {
      kk = mereRegs.end[0] ;
      ***************
      *** 384,390 ****
      }
      lnno++ ;
      ii = llength(lp) ;
      ! if((ii=re_search_2(&mereBuffer,NULL,0,(char *) ltext(lp),ii,0,ii,&mereRegs,ii)) >= 0)
      break ;
      }
      }
      --- 389,396 ----
      }
      lnno++ ;
      ii = llength(lp) ;
      ! if((ii=re_search_2(&mereBuffer,NULL,0,(char *) ltext(lp),ii,
      ! 0,ii,&mereRegs,ii)) >= 0)
      break ;
      }
      }
      ***************
      *** 399,405 ****
      }
      lnno-- ;
      ii = llength(lp) ;
      ! if((ii=re_search_2(&mereBuffer,NULL,0,(char *) ltext(lp),ii,ii-1,-ii,&mereRegs,ii)) >= 0)
      break ;
      }
      }
      --- 405,412 ----
      }
      lnno-- ;
      ii = llength(lp) ;
      ! if((ii=re_search_2(&mereBuffer,NULL,0,(char *) ltext(lp),ii,
      ! ii,-ii,&mereRegs,ii)) >= 0)
      break ;
      }
      }
      ***************
      *** 435,441 ****
      jj = llength(lp) ;
      lputc(lp,jj,meNLCHAR) ;
      ii = re_search_2(&mereBuffer,(char *) ltext(lp),jj+1,(char *) ltext(nlp),kk,
      ! jj+1+ii-1,0-(jj+1+ii),&mereRegs,jj+1+kk) ;
      lputc(lp,jj,0) ;
      }
      if(ii < 0)
      --- 442,448 ----
      jj = llength(lp) ;
      lputc(lp,jj,meNLCHAR) ;
      ii = re_search_2(&mereBuffer,(char *) ltext(lp),jj+1,(char *) ltext(nlp),kk,
      ! jj+1+((ii) ? ii-1:0),0-(jj+1+ii),&mereRegs,jj+1+kk) ;
      lputc(lp,jj,0) ;
      }
      if(ii < 0)
      ***************
      *** 560,566 ****
      offs,jj,&mereRegs,jj) ;
      else
      ii = re_search_2(&mereBuffer,NULL,0,mereNewlBuf,jj,
      ! jj-offs-1,0-(jj-offs),&mereRegs,jj) ;
      if(ii >= 0)
      break ;
      }
      --- 567,573 ----
      offs,jj,&mereRegs,jj) ;
      else
      ii = re_search_2(&mereBuffer,NULL,0,mereNewlBuf,jj,
      ! jj-((offs) ? offs-1:0),0-(jj-offs),&mereRegs,jj) ;
      if(ii >= 0)
      break ;
      }
      [EXIT]
    Your message has been successfully submitted and would be delivered to recipients shortly.