]> granicus.if.org Git - graphviz/commitdiff
DFLT_GVPRPATH now includes <prefix>/share/graphviz/gvpr/
authorJohn Ellson <ellson@research.att.com>
Fri, 24 Feb 2012 20:37:25 +0000 (15:37 -0500)
committerJohn Ellson <ellson@research.att.com>
Fri, 24 Feb 2012 20:37:25 +0000 (15:37 -0500)
lib/gvpr/Makefile.am
lib/gvpr/gvpr.c

index 33ef9d3fe15e22e4f7c71db8e3c386e73f198e82..5f42e37e8f9ac0d90bd9c8d8c2973c016c52ff21 100644 (file)
@@ -15,7 +15,8 @@ AM_CPPFLAGS = \
        -I$(top_srcdir)/lib/ingraphs \
        -I$(top_srcdir)/lib/common \
        -I$(top_srcdir)/lib/cgraph \
-       -I$(top_srcdir)/lib/cdt
+       -I$(top_srcdir)/lib/cdt \
+       -DDFLT_GVPRPATH="\".$(PATH_SEPARATOR)$(pkgdatadir)/gvpr\""
 
 pkginclude_HEADERS = gvpr.h
 noinst_PROGRAMS = mkdefs
index e826766f28a53a27ab366a8b2b824393e02d4264..3d0c8f441e8564f7477bba3ace67e5fcac3bd923 100644 (file)
@@ -44,7 +44,9 @@
 #include <getopt.h>
 #endif
 
-#define DFLT_GPRPATH    "."
+#ifndef DFLT_GVPRPATH
+#define DFLT_GVPRPATH    "."
+#endif
 
 #define GV_USE_JUMP 4
 
@@ -192,7 +194,7 @@ static int parseArgs(char *s, int argc, char ***argv)
 /* resolve:
  * Translate -f arg parameter into a pathname.
  * If arg contains '/', return arg.
- * Else search directories in GPRPATH for arg.
+ * Else search directories in GVPRPATH for arg.
  * Return NULL on error.
  * 
  * FIX - use pathinclude/pathfind
@@ -213,9 +215,11 @@ static char *resolve(char *arg)
 #endif
        return strdup(arg);
 
-    path = getenv("GPRPATH");
+    path = getenv("GVPRPATH");
+    if (!path)
+       path = getenv("GPRPATH");  // deprecated
     if (!path)
-       path = DFLT_GPRPATH;
+       path = DFLT_GVPRPATH;
 
     if (!(fp = sfstropen())) {
        error(ERROR_ERROR, "Could not open buffer");
@@ -246,7 +250,7 @@ static char *resolve(char *arg)
     }
 
     if (!fname)
-       error(ERROR_ERROR, "Could not find file \"%s\" in GPRPATH", arg);
+       error(ERROR_ERROR, "Could not find file \"%s\" in GVPRPATH", arg);
 
     sfclose(fp);
     return fname;
@@ -911,7 +915,7 @@ int gvpr (int argc, char *argv[], gvpropts * uopts)
     int rv = 0;
     options* opts = 0;
     int cleanup, i, incoreGraphs;
-    Agraph_t* nextg;
+    Agraph_t* nextg = NULL;
 
     setErrorErrors (0);
     ingDisc.dflt = sfstdin;