Hi tech --
A very recent clang says:
/home/brian/llvm/build-build/bin/clang -O2 -pipe -Wall -DFKEYS -DREGEX -DXKEYS
-Werror-implicit-function-declaration -c /usr/src/usr.bin/mg/dired.c
/usr/src/usr.bin/mg/dired.c:216:13: warning: address of array 'curbp->b_fname'
will always evaluate to 'true' [-Wpointer-bool-conversion]
if (curbp->b_fname && curbp->b_fname[0] != '\0') {
~~~~~~~^~~~~~~ ~~
/usr/src/usr.bin/mg/dired.c:246:13: warning: address of array 'curbp->b_fname'
will always evaluate to 'true' [-Wpointer-bool-conversion]
if (curbp->b_fname && curbp->b_fname[0] != '\0') {
~~~~~~~^~~~~~~ ~~
2 warnings generated.
Diff below to kill the warnings.
OK?
~Brian
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';