diff options
author | Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | 2010-06-22 11:19:40 -0400 |
---|---|---|
committer | Sadrul Habib Chowdhury <sadrul@users.sourceforge.net> | 2010-06-22 11:22:31 -0400 |
commit | a805439f6443fb0e00ac6caff92f99950c1ddda8 (patch) | |
tree | ee20036421071320d076688a7529db84787e8ef4 | |
parent | dfab4600877ee79c6ff004e88f331ff300ba2ad7 (diff) | |
download | screen-a805439f6443fb0e00ac6caff92f99950c1ddda8.tar.gz |
Fix layout ordering.
Layouts were being stored in a reversed list. This makes it
confusing for both users and developers with regards to what the
next layout is ('next', lay_next). So store the layouts in a
properly ordered list in order to avoid the confusion.
This closes savannah #29800.
-rw-r--r-- | src/layout.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/layout.c b/src/layout.c index 6100b5d..196d10b 100644 --- a/src/layout.c +++ b/src/layout.c @@ -64,7 +64,7 @@ CreateLayout(title, startat) char *title; int startat; { - struct layout *lay; + struct layout *lay, **pl; int i; if (startat >= MAXLAY || startat < 0) @@ -86,8 +86,12 @@ int startat; lay->lay_autosave = 1; lay->lay_number = i; laytab[i] = lay; - lay->lay_next = layouts; - layouts = lay; + lay->lay_next = 0; + + pl = &layouts; + while (*pl) + pl = &(*pl)->lay_next; + *pl = lay; return lay; } |