Menu

#251 removed code duplication in dofile1()

open
nobody
None
5
2008-11-10
2008-11-10
No

Here is the patch:

Index: ufile.c

--- ufile.c (revision 31)
+++ ufile.c (working copy)
@@ -573,6 +573,7 @@
}

b = bfind_reload(s);
+ display_it:
er = berror;
if (bw->b->count == 1 && (bw->b->changed || bw->b->name)) {
if (orphan) {
@@ -620,44 +621,7 @@
}

b = bfind(s);
- er = berror;
- if (bw->b->count == 1 && (bw->b->changed || bw->b->name)) {
- if (orphan) {
- orphit(bw);
- } else {
- if (uduptw(bw)) {
- brm(b);
- return -1;
- }
- bw = (BW *) maint->curwin->object;
- }
- }
- if (er) {
- msgnwt(bw->parent, joe_gettext(msgs[-er]));
- if (er != -1) {
- ret = -1;
- }
- }
- object = bw->object;
- w = bw->parent;
- bwrm(bw);
- w->object = (void *) (bw = bwmk(w, b, 0));
- wredraw(bw->parent);
- bw->object = object;
- vsrm(s);
- if (er == -1 && bw->o.mnew) {
- exmacro(bw->o.mnew,1);
- }
- if (er == 0 && bw->o.mold) {
- exmacro(bw->o.mold,1);
- }
- /* Restore cursor line */
- pline(bw->cursor, get_file_pos(bw->b->name));
- omid = mid;
- mid = 1;
- dofollows();
- mid = omid;
- return ret;
+ goto display_it;
} else {
/* FIXME: need abort handler to prevent leak */
if (mkqw(bw->parent, sz(joe_gettext(_("Load original file from disk (y,n,^C)? "))), doedit1, NULL, s, notify))

Discussion


Log in to post a comment.