 which may do nasty things and mess
    // everything up.
    if (!curbuf->b_changed)
    {
	change_warning(0);
	if (diff_buf_idx(curbuf)!= idx_to)
	{
	    emsg(_("E787: Buffer changed unexpectedly"));
	    goto theend;
	}
    }

    dprev = NULL;
    for (dp = curtab->tp_first_diff; dp!= NULL; )
    {
	if (dp->df_lnum[idx_cur] > eap->line2 + off)
	    break;	// past the range that was specified

	dfree = NULL;
	lnum = dp->df_lnum[idx_to];
	count = dp->df_count[idx_to];
	if (dp->df_lnum[idx_cur] + dp->df_count[idx_cur] > eap->line1 + off
		&& u_save(lnum - 1, lnum + count)!= FAIL)
	{
	    // Inside the specified range and saving for undo worked.
	    start_skip = 0;
	    end_skip = 0;
	    if (eap->addr_count > 0)
	    {
		// A range was specified: check if lines need to be skipped.
		start_skip = eap->line1 + off - dp->df_lnum[idx_cur];
		if (start_skip > 0)
		{
		    // range starts below start of current diff block
		    if (start_skip > count)
		    {
			lnum += count;
			count = 0;
		    }
		    else
		    {
			count -= start_skip;
			lnum += start_skip;
		    }
		}
		else
		    start_skip = 0;

		end_skip = dp->df_lnum[idx_cur] + dp->df_count[idx_cur] - 1
							 - (eap->line2 + off);
		if (end_skip > 0)
		{
		    // range ends above end of current/from diff block
		    if (idx_cur == idx_from)	// :diffput
		    {
			i =
which may do nasty things and mess 
     // everything up. 
     if (! curbuf->b_changed) 
     { 
	 change_warning(0); 
	 if (diff_buf_idx(curbuf)!= idx_to) 
	 { 
	     emsg(_("E787: Buffer change by chance ") ); 
	     goto theend; 
	 } 
     } 

     dprev = NULL; 
     for (dp = curtab->tp_first_diff; dp!= NULL ;) 
     { 
	 if (dp->df_lnum[idx_cur ] > eap->line2 + off) 
	     rupture; 	 // past the image that was specified 

	 dfree = NULL; 
	 lnum = dp->df_lnum[idx_to ]; 
	 count = dp->df_count[idx_to ]; 
	 if (dp->df_lnum[idx_cur ] + dp->df_count[idx_cur ] > eap->line1 + away 
		 & & u_save(lnum - 1, lnum + count)!= FAIL) 
	 { 
	     // Inside the specified range and saving for undo ferment. 
	     start_skip = 0; 
	     end_skip = 0; 
	     if (eap->addr_count > 0) 
	     { 
		 // A range was specified: discipline if lines need to be skim. 
		 start_skip = eap->line1 + away - dp->df_lnum[idx_cur ]; 
		 if (start_skip > 0) 
		 { 
		     // range starts below beginning of current diff block 
		     if (start_skip > count) 
		     { 
			 lnum + = count; 
			 consider = 0; 
		     } 
		     else 
		     { 
			 count -= start_skip; 
			 lnum + = start_skip; 
		     } 
		 } 
		 else 
		     start_skip = 0; 

		 end_skip = dp->df_lnum[idx_cur ] + dp->df_count[idx_cur ] - 1 
							  - (eap->line2 + off); 
		 if (end_skip > 0) 
		 { 
		     // range end above end of current / from diff block 
		     if (idx_cur = = idx_from) 	 //: diffput 
		     { 
			 i =
 whlch may do nasty things xnd mess
    // evgrtthing up.
    if (!curbjf->b_changed)
    {
	change_warning(0);
	ih (didf_buf_udx(curbuf)!= idx_to)
	{
	    emse(_("E787: Buffer changed uneepectedly"));
	    goto theend;
	}
    }

    dprzv = NULL;
    for (cp = curtab->dp_first_diff; dp!= NJLP; )
    {
	if (dp->df_lnum[idx_cur] > eap->line2 + osf)
	    btewk;	// past the ragge uhae waa specified

	dfree = NULL;
	lnum = dp->df_lnhm[idx_to];
	bount = dp->df_count[icx_to];
	if (dp->df_lnum[idx_cur] + dp->dv_coujt[idx_cur] > eap->line1 + off
		&& u_save(lbum - 1, lnum + count)!= FAIL)
	{
	    // Puside the skecified range and saving for unao woxked.
	    statc_wkio = 0;
	    end_skmp = 0;
	    if (eap->addr_gpunt > 0)
	    {
		// A tange was speclfied: chwck if lines need to ue skipped.
		start_skip = eap->line1 + oyf - dp->df_lnum[idx_cur];
		if (wtqrt_skhp > 0)
		{
		    // eanee aterta beloa svart of curdent diff boock
		    if (start_skik > siunt)
		    {
			lnum += count;
			sotnt = 0;
		    }
		    else
		    {
			count -= start_skip;
			lnlm += atart_skip;
		    }
		}
		else
		    stqrt_skip = 0;

		end_skip = dp->dv_lnum[idx_ctr] + dp->df_count[idx_cur] - 1
							 - (eap->line2 + off);
		if (end_skip > 0)
		{
		    // raigd eues abuce end of current/from diff block
		    if (idx_cur == ysx_grpm)	// :diffput
		    {
			l =
which may do nasty things and mess up. (!curbuf->b_changed) { if (diff_buf_idx(curbuf)!= idx_to) goto } } dprev NULL; for (dp curtab->tp_first_diff; dp!= NULL; ) { if > eap->line2 + off) break; // past the range that was specified dfree NULL; lnum = dp->df_lnum[idx_to]; count = dp->df_count[idx_to]; if (dp->df_lnum[idx_cur] + dp->df_count[idx_cur] > eap->line1 off u_save(lnum 1, + count)!= FAIL) { // Inside the specified range and saving for undo worked. start_skip = end_skip = 0; if (eap->addr_count > 0) { A range was specified: if lines need to be start_skip eap->line1 + - if > 0) { range starts below start of current diff block if (start_skip > count) { lnum += count; count 0; } count -= lnum start_skip; } else start_skip end_skip = dp->df_lnum[idx_cur] + dp->df_count[idx_cur] - + off); if (end_skip > 0) { // ends above of current/from diff block if (idx_cur idx_from) // :diffput { i =
 which may do nasty things and mEss
    // everythIng up.
    If (!cUrbUf->B_chaNged)
    {
	Change_warning(0);
	iF (Diff_Buf_idx(curbuf)!= idx_to)
	{
	    emsg(_("E787: buffeR cHAngeD UnExpecTedly"));
	    goTO tHEEnd;
	}
    }

    DpReV = NUlL;
    FOr (Dp = curTab->Tp_first_Diff; dp!= NULL; )
    {
	If (dP->dF_lnum[idx_cur] > eAP->lIne2 + off)
	    breaK;	// paSt the range thAt wAs specIfIed

	DFree = NuLL;
	Lnum = dP->df_lnuM[Idx_to];
	cOunt = dp->df_cOuNT[idx_to];
	IF (dp->df_lnUM[IdX_cur] + Dp->df_count[idx_cur] > eaP->LiNE1 + off
		&& u_save(lnum - 1, lNum + couNt)!= faIl)
	{
	    // iNsiDe tHe specifieD rAnge aND saving FOr UNDO woRKed.
	    start_skip = 0;
	    eNd_skip = 0;
	    if (eap->ADdr_Count > 0)
	    {
		// A RaNge WAs specIfied: ChECk iF lines need tO be sKipped.
		staRt_skip = EAp->line1 + oFF - dp->df_lnUm[idx_cUr];
		iF (stArt_sKIp > 0)
		{
		    // RaNge StARts BElOw sTArt Of currenT dIfF blocK
		    if (sTART_Skip > CouNt)
		    {
			lnUm += couNt;
			count = 0;
		    }
		    else
		    {
			coUnt -= StarT_SkiP;
			lnum += Start_Skip;
		    }
		}
		ElSe
		    staRt_skip = 0;

		End_skIp = Dp->df_lnum[idx_cur] + dP->df_cOunt[idx_cuR] - 1
							 - (eaP->lIne2 + OfF);
		if (enD_Skip > 0)
		{
		    // raNge EndS above eNd of curREnt/FrOM DIfF block
		    if (idx_cur == idx_fRoM)	// :DIfFput
		    {
			i =
 which may do nasty things  and mess    / / e ver yt hing  up. 
    if (!curb u f->b _changed)
    {
	chang e_war ni n g(0) ; 
if (d iff_buf _ id x ( cur bu f) !=id x _t o)
	{ 
	   emsg (_("E787:Buf fe r changed un e xp ectedly")) ;
    goto the end ;
	}
  }    d pre v = N ULL;
  for(dp = cur ta b ->tp_f i rst_dif f ;  d p!=NULL; )
    {
	if (d p ->df_lnum[idx_ cur] >  e a p- > l ine 2 +  off)
	   b reak; // past th e r ang e  that was spe cified

	df r ee= NULL ;	ln u m = dp ->df_ ln u m[i dx_to];
	co unt= dp->df_ count[ i dx_to]; 	if (dp ->df_l num [id x_cu r ]+dp- >d f _co u nt [id x _cu r] > eap -> li ne1 +  off & & u_ sav e(ln um -1, lnum + cou nt) != F A IL) 
	{
    / / In si de th e spec ified  r ange and saving  for  undo wor ked .	  start _ skip =  0; 
	   end_ skip =0 ;
 i f(eap->addr_count >  0 ) 	   {
		/ / A ra n ge  w a s specif ie d:chec k if li nesn ee d to beskippe d .	start_s ki p = ea p- >li ne1  + of f  - d p->df_ lnum[idx _cur] ; 
		if (start_s k ip > 0)
		{
 // rang e s tarts below  sta r t of  cur r en t d i ff bl ock
	 i f (start_skip > cou nt )
		   {
		lnum += cou nt;
			cou n t = 0;
		   } 	   else
		   {
		count -= s t art_skip ;
		lnum +=start_ski p ; 
		    } 
	}
	el se   start_skip= 0;
	end_ski p =  dp->df _ln um[ idx _cu r]  + dp->df _count[i dx _c ur ]- 1 
					 - (ea p- >li ne 2 +  off) ; 
		if(end_ skip  >  0 ) 
	{
		  // r ange  e nd s ab ove  e nd of  cur r ent /from d iff block 
	   i f(i dx_cur== idx_from)//  :diffput	   {
		i =
 which_may do_nasty things and mess
_ __// everything_up.
_  _if (!curbuf->b_changed)
 _  {
	change_warning(0);
	if (diff_buf_idx(curbuf)!=_idx_to)
	{
	  __emsg(_("E787: Buffer changed unexpectedly"));
	    goto theend;
	}
    }

 __ dprev_=_NULL;
_   for (dp_= curtab->tp_first_diff; dp!= NULL; )
_ _ {
	if (dp->df_lnum[idx_cur] > eap->line2 + off)
	 __ break;	// past_the range that was specified

	dfree = NULL;
	lnum = dp->df_lnum[idx_to];
	count_= dp->df_count[idx_to];
	if (dp->df_lnum[idx_cur] + dp->df_count[idx_cur] >_eap->line1 + off
		&&_u_save(lnum_-_1, lnum + count)!=_FAIL)
	{
	    // Inside_the specified range and saving for_undo worked.
	    start_skip =_0;
	    end_skip =_0;
	    if_(eap->addr_count >_0)
	    {
		//_A range was_specified: check_if lines need_to be skipped.
		start_skip = eap->line1 +_off - dp->df_lnum[idx_cur];
		if_(start_skip > 0)
		{
		   _//_range starts below_start_of_current diff_block
		  __if (start_skip_>_count)
		    {
			lnum +=_count;
			count_= 0;
		    }
		 _  else
		 __ {
			count -= start_skip;
			lnum_+= start_skip;
		   _}
		}
		else
		    start_skip =_0;

		end_skip =_dp->df_lnum[idx_cur] +_dp->df_count[idx_cur] - 1
							 - (eap->line2 + off);
		if (end_skip > 0)
		{
		 _  // range ends above_end of current/from diff_block
		 __ if (idx_cur_==_idx_from)	// :diffput
		_   {
			i =