linenum.c (161475) | linenum.c (170256) |
---|---|
1/* | 1/* |
2 * Copyright (C) 1984-2004 Mark Nudelman | 2 * Copyright (C) 1984-2007 Mark Nudelman |
3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information about less, or for information on how to 8 * contact the author, see the README file. 9 */ 10 --- 298 unchanged lines hidden (view full) --- 309 if (ch_seek(p->pos)) 310 return (0); 311 loopcount = 0; 312 for (linenum = p->line, cpos = p->pos; cpos < pos; linenum++) 313 { 314 /* 315 * Allow a signal to abort this loop. 316 */ | 3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information about less, or for information on how to 8 * contact the author, see the README file. 9 */ 10 --- 298 unchanged lines hidden (view full) --- 309 if (ch_seek(p->pos)) 310 return (0); 311 loopcount = 0; 312 for (linenum = p->line, cpos = p->pos; cpos < pos; linenum++) 313 { 314 /* 315 * Allow a signal to abort this loop. 316 */ |
317 cpos = forw_raw_line(cpos, (char **)NULL); | 317 cpos = forw_raw_line(cpos, (char **)NULL, (int *)NULL); |
318 if (ABORT_SIGS() || cpos == NULL_POSITION) 319 return (0); 320 longish(); 321 } 322 lnloop = 0; 323 /* 324 * We might as well cache it. 325 */ --- 12 unchanged lines hidden (view full) --- 338 if (ch_seek(p->pos)) 339 return (0); 340 loopcount = 0; 341 for (linenum = p->line, cpos = p->pos; cpos > pos; linenum--) 342 { 343 /* 344 * Allow a signal to abort this loop. 345 */ | 318 if (ABORT_SIGS() || cpos == NULL_POSITION) 319 return (0); 320 longish(); 321 } 322 lnloop = 0; 323 /* 324 * We might as well cache it. 325 */ --- 12 unchanged lines hidden (view full) --- 338 if (ch_seek(p->pos)) 339 return (0); 340 loopcount = 0; 341 for (linenum = p->line, cpos = p->pos; cpos > pos; linenum--) 342 { 343 /* 344 * Allow a signal to abort this loop. 345 */ |
346 cpos = back_raw_line(cpos, (char **)NULL); | 346 cpos = back_raw_line(cpos, (char **)NULL, (int *)NULL); |
347 if (ABORT_SIGS() || cpos == NULL_POSITION) 348 return (0); 349 longish(); 350 } 351 lnloop = 0; 352 /* 353 * We might as well cache it. 354 */ --- 38 unchanged lines hidden (view full) --- 393 p = p->prev; 394 if (ch_seek(p->pos)) 395 return (NULL_POSITION); 396 for (clinenum = p->line, cpos = p->pos; clinenum < linenum; clinenum++) 397 { 398 /* 399 * Allow a signal to abort this loop. 400 */ | 347 if (ABORT_SIGS() || cpos == NULL_POSITION) 348 return (0); 349 longish(); 350 } 351 lnloop = 0; 352 /* 353 * We might as well cache it. 354 */ --- 38 unchanged lines hidden (view full) --- 393 p = p->prev; 394 if (ch_seek(p->pos)) 395 return (NULL_POSITION); 396 for (clinenum = p->line, cpos = p->pos; clinenum < linenum; clinenum++) 397 { 398 /* 399 * Allow a signal to abort this loop. 400 */ |
401 cpos = forw_raw_line(cpos, (char **)NULL); | 401 cpos = forw_raw_line(cpos, (char **)NULL, (int *)NULL); |
402 if (ABORT_SIGS() || cpos == NULL_POSITION) 403 return (NULL_POSITION); 404 } 405 } else 406 { 407 /* 408 * Go backward. 409 */ 410 if (ch_seek(p->pos)) 411 return (NULL_POSITION); 412 for (clinenum = p->line, cpos = p->pos; clinenum > linenum; clinenum--) 413 { 414 /* 415 * Allow a signal to abort this loop. 416 */ | 402 if (ABORT_SIGS() || cpos == NULL_POSITION) 403 return (NULL_POSITION); 404 } 405 } else 406 { 407 /* 408 * Go backward. 409 */ 410 if (ch_seek(p->pos)) 411 return (NULL_POSITION); 412 for (clinenum = p->line, cpos = p->pos; clinenum > linenum; clinenum--) 413 { 414 /* 415 * Allow a signal to abort this loop. 416 */ |
417 cpos = back_raw_line(cpos, (char **)NULL); | 417 cpos = back_raw_line(cpos, (char **)NULL, (int *)NULL); |
418 if (ABORT_SIGS() || cpos == NULL_POSITION) 419 return (NULL_POSITION); 420 } 421 } 422 /* 423 * We might as well cache it. 424 */ 425 add_lnum(clinenum, cpos); --- 27 unchanged lines hidden --- | 418 if (ABORT_SIGS() || cpos == NULL_POSITION) 419 return (NULL_POSITION); 420 } 421 } 422 /* 423 * We might as well cache it. 424 */ 425 add_lnum(clinenum, cpos); --- 27 unchanged lines hidden --- |