$NetBSD: patch-ap,v 1.11 2009/02/26 19:45:14 sno Exp $

--- lib/gvc/gvconfig.c.orig	2009-02-25 17:46:45.000000000 +0000
+++ lib/gvc/gvconfig.c	2009-04-25 18:18:53.000000000 +0000
@@ -543,11 +543,7 @@
         }
         else {
     	    f = fopen(gvc->config_path,"r");
-    	    if (!f) {
-    	        agerr (AGERR,"failed to open %s for read.\n", gvc->config_path);
-		exit(1);
-    	    }
-    	    else {
+    	    if (f) {
     	        config_text = gmalloc(config_st.st_size + 1);
     	        sz = fread(config_text, 1, config_st.st_size, f);
     	        if (sz == 0) {
@@ -560,10 +556,13 @@
     	            rc = gvconfig_plugin_install_from_config(gvc, config_text);
     		    /* NB. config_text not freed because we retain char* into it */
     	        }
-    	    }
-    	    if (f) {
+
     	        fclose(f);
-	    }
+    	    }
+    	    else {
+    	        agerr (AGERR,"failed to open %s for read.\n", gvc->config_path);
+		exit(1);
+    	    }
         }
     }
 #endif
