Changeset a85d225 for editwin.c


Ignore:
Timestamp:
Oct 7, 2009, 12:46:39 AM (12 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
6c171f1
Parents:
5791bf7
git-author:
Anders Kaseorg <andersk@mit.edu> (10/03/09 19:38:43)
git-committer:
Anders Kaseorg <andersk@mit.edu> (10/07/09 00:46:39)
Message:
oe_release_excursion: Simplify linked list deletion code.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r2184001 ra85d225  
    326326static void oe_release_excursion(owl_editwin *e, oe_excursion *x)
    327327{
    328   oe_excursion *p;
     328  oe_excursion **px;
    329329
    330330  x->valid = 0;
    331   if (e->excursions == NULL)
    332     /* XXX huh. */ ;
    333   else if (e->excursions == x)
    334     e->excursions = x->next;
    335   else {
    336     for (p = e->excursions; p->next != NULL; p = p->next)
    337       if (p->next == x) {
    338         p->next = p->next->next;
    339         break;
    340       }
    341     /* and if we ran off the end? XXX */
    342   }
     331  for (px = &e->excursions; *px != NULL; px = &(*px)->next)
     332    if (*px == x) {
     333      *px = x->next;
     334      return;
     335    }
     336  abort();
    343337}
    344338
Note: See TracChangeset for help on using the changeset viewer.