Unix Technical Forum

redundant code in dired.c

This is a discussion on redundant code in dired.c within the lucky.openbsd.tech forums, part of the OpenBSD category; --> Hi, While trying to fix something else I found this redundant code: Index: dired.c ================================================== ================= RCS file: /cvs/src/usr.bin/mg/dired.c,v ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > lucky.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-22-2008, 11:51 AM
Han Boetes
 
Posts: n/a
Default redundant code in dired.c

Hi,

While trying to fix something else I found this redundant code:

Index: dired.c
================================================== =================
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.21
diff -u -p -r1.21 dired.c
--- dired.c 9 Aug 2005 00:53:48 -0000 1.21
+++ dired.c 8 Oct 2005 21:15:52 -0000
@@ -143,9 +143,6 @@ dired(int f, int n)
return (FALSE);
if ((bp = dired_(bufp)) == NULL)
return (FALSE);
- bp->b_modes[0] = name_mode("fundamental");
- bp->b_modes[1] = name_mode("dired");
- bp->b_nmodes = 1;
curbp = bp;
return (showbuffer(bp, curwp, WFHARD | WFMODE));
}


Because in fileio.c where dired_() resides:

[snip]
if ((bp->b_modes[1] = name_mode("dired")) == NULL) {
bp->b_modes[0] = name_mode("fundamental");
ewprintf("Could not find mode dired");
return (NULL);
}
bp->b_nmodes = 1;
return (bp);
}

So dired_() already does this.



# Han

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:11 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com