Deleted Added
full compact
edit.c (128345) edit.c (161475)
1/*
1/*
2 * Copyright (C) 1984-2002 Mark Nudelman
2 * Copyright (C) 1984-2005 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

--- 306 unchanged lines hidden (view full) ---

317 free(alt_filename);
318 }
319 del_ifile(ifile);
320 free(qopen_filename);
321 free(filename);
322 /*
323 * Re-open the current file.
324 */
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

--- 306 unchanged lines hidden (view full) ---

317 free(alt_filename);
318 }
319 del_ifile(ifile);
320 free(qopen_filename);
321 free(filename);
322 /*
323 * Re-open the current file.
324 */
325 if (was_curr_ifile == ifile)
326 {
327 /*
328 * Whoops. The "current" ifile is the one we just deleted.
329 * Just give up.
330 */
331 quit(QUIT_ERROR);
332 }
325 reedit_ifile(was_curr_ifile);
326 return (1);
327 } else if ((f = open(qopen_filename, OPEN_READ)) < 0)
328 {
329 /*
330 * Got an error trying to open it.
331 */
332 parg.p_string = errno_message(filename);

--- 160 unchanged lines hidden (view full) ---

493edit_last()
494{
495 curr_ifile = NULL_IFILE;
496 return (edit_prev(1));
497}
498
499
500/*
333 reedit_ifile(was_curr_ifile);
334 return (1);
335 } else if ((f = open(qopen_filename, OPEN_READ)) < 0)
336 {
337 /*
338 * Got an error trying to open it.
339 */
340 parg.p_string = errno_message(filename);

--- 160 unchanged lines hidden (view full) ---

501edit_last()
502{
503 curr_ifile = NULL_IFILE;
504 return (edit_prev(1));
505}
506
507
508/*
501 * Edit the next or previous file in the command line (ifile) list.
509 * Edit the n-th next or previous file in the command line (ifile) list.
502 */
503 static int
504edit_istep(h, n, dir)
505 IFILE h;
506 int n;
507 int dir;
508{
509 IFILE next;

--- 32 unchanged lines hidden (view full) ---

542 return (0);
543}
544
545 static int
546edit_inext(h, n)
547 IFILE h;
548 int n;
549{
510 */
511 static int
512edit_istep(h, n, dir)
513 IFILE h;
514 int n;
515 int dir;
516{
517 IFILE next;

--- 32 unchanged lines hidden (view full) ---

550 return (0);
551}
552
553 static int
554edit_inext(h, n)
555 IFILE h;
556 int n;
557{
550 return (edit_istep(h, n, 1));
558 return (edit_istep(h, n, +1));
551}
552
553 public int
554edit_next(n)
555 int n;
556{
559}
560
561 public int
562edit_next(n)
563 int n;
564{
557 return edit_istep(curr_ifile, n, 1);
565 return edit_istep(curr_ifile, n, +1);
558}
559
560 static int
561edit_iprev(h, n)
562 IFILE h;
563 int n;
564{
565 return (edit_istep(h, n, -1));

--- 214 unchanged lines hidden ---
566}
567
568 static int
569edit_iprev(h, n)
570 IFILE h;
571 int n;
572{
573 return (edit_istep(h, n, -1));

--- 214 unchanged lines hidden ---