Hi Brian,

this looks right:  It is easy to see that curbp->b_fname can never
be NULL, and entering dired mode still works for me both from *scratch*
and from a file buffer.

Yours,
  Ingo

> Index: dired.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/mg/dired.c,v
> retrieving revision 1.68
> diff -u -p -r1.68 dired.c
> --- dired.c   16 Nov 2014 04:16:41 -0000      1.68
> +++ dired.c   27 Dec 2014 22:07:52 -0000
> @@ -213,7 +213,7 @@ dired(int f, int n)
>       char             dname[NFILEN], *bufp, *slash;
>       struct buffer   *bp;
>  
> -     if (curbp->b_fname && curbp->b_fname[0] != '\0') {
> +     if (curbp->b_fname[0] != '\0') {
>               (void)strlcpy(dname, curbp->b_fname, sizeof(dname));
>               if ((slash = strrchr(dname, '/')) != NULL) {
>                       *(slash + 1) = '\0';
> @@ -243,7 +243,7 @@ d_otherwindow(int f, int n)
>       struct buffer   *bp;
>       struct mgwin    *wp;
>  
> -     if (curbp->b_fname && curbp->b_fname[0] != '\0') {
> +     if (curbp->b_fname[0] != '\0') {
>               (void)strlcpy(dname, curbp->b_fname, sizeof(dname));
>               if ((slash = strrchr(dname, '/')) != NULL) {
>                       *(slash + 1) = '\0';
> 

Reply via email to