Revision: 71156
          http://sourceforge.net/p/brlcad/code/71156
Author:   brlcad
Date:     2018-07-11 19:41:01 +0000 (Wed, 11 Jul 2018)
Log Message:
-----------
revert c71145.  helps to read the api header as bu_brlcad_dir is supposed to 
return the relative dir, not the whole path.  might want to 
reconsider/consolidate this API though, since this is only a problem in a very 
limited context.

Modified Paths:
--------------
    brlcad/trunk/src/libbu/brlcad_path.c

Modified: brlcad/trunk/src/libbu/brlcad_path.c
===================================================================
--- brlcad/trunk/src/libbu/brlcad_path.c        2018-07-11 12:04:42 UTC (rev 
71155)
+++ brlcad/trunk/src/libbu/brlcad_path.c        2018-07-11 19:41:01 UTC (rev 
71156)
@@ -225,6 +225,67 @@
 
 
 const char *
+bu_brlcad_dir(const char *dirkey, int fail_quietly)
+{
+    static char result[MAXPATHLEN] = {0};
+    if (BU_STR_EQUAL(dirkey, "bin")) {
+#if defined(BRLCAD_BIN_DIR)
+       snprintf(result, MAXPATHLEN, "%s", BRLCAD_BIN_DIR);
+#else
+       snprintf(result, MAXPATHLEN, "%s", "bin");
+#endif
+       return result;
+    }
+    if (BU_STR_EQUAL(dirkey, "lib")) {
+#if defined(BRLCAD_LIB_DIR)
+       snprintf(result, MAXPATHLEN, "%s", BRLCAD_LIB_DIR);
+#else
+       snprintf(result, MAXPATHLEN, "%s", "lib");
+#endif
+       return result;
+    }
+    if (BU_STR_EQUAL(dirkey, "include")) {
+#if defined(BRLCAD_INCLUDE_DIR)
+       snprintf(result, MAXPATHLEN, "%s", BRLCAD_INCLUDE_DIR);
+#else
+       snprintf(result, MAXPATHLEN, "%s", "include");
+#endif
+       return result;
+    }
+    if (BU_STR_EQUAL(dirkey, "data") || BU_STR_EQUAL(dirkey, "share")) {
+#if defined(BRLCAD_DATA_DIR)
+       snprintf(result, MAXPATHLEN, "%s", BRLCAD_DATA_DIR);
+#else
+       snprintf(result, MAXPATHLEN, "%s", "share");
+#endif
+       return result;
+    }
+    if (BU_STR_EQUAL(dirkey, "doc")) {
+#if defined(BRLCAD_DOC_DIR)
+       snprintf(result, MAXPATHLEN, "%s", BRLCAD_DOC_DIR);
+#else
+       snprintf(result, MAXPATHLEN, "%s", "doc");
+#endif
+       return result;
+    }
+    if (BU_STR_EQUAL(dirkey, "man")) {
+#if defined(BRLCAD_MAN_DIR)
+       snprintf(result, MAXPATHLEN, "%s", BRLCAD_MAN_DIR);
+#else
+       snprintf(result, MAXPATHLEN, "%s", "share/man");
+#endif
+       return result;
+    }
+
+
+    if (!fail_quietly) {
+       snprintf(result, MAXPATHLEN, "Unknown directory key %s", dirkey);
+       return result;
+    }
+    return NULL;
+}
+
+const char *
 bu_brlcad_root(const char *rhs, int fail_quietly)
 {
     static char result[MAXPATHLEN] = {0};
@@ -522,72 +583,6 @@
 }
 
 
-const char *
-bu_brlcad_dir(const char *dirkey, int fail_quietly)
-{
-    static char result[MAXPATHLEN] = {0};
-
-    if (BU_STR_EMPTY(dirkey)) {
-       return bu_brlcad_root("", fail_quietly);
-    }
-
-    if (BU_STR_EQUAL(dirkey, "bin")) {
-#if defined(BRLCAD_BIN_DIR)
-       snprintf(result, MAXPATHLEN, "%s", BRLCAD_BIN_DIR);
-#else
-       snprintf(result, MAXPATHLEN, "%s", bu_brlcad_root("bin", fail_quietly));
-#endif
-       return result;
-    }
-    if (BU_STR_EQUAL(dirkey, "lib")) {
-#if defined(BRLCAD_LIB_DIR)
-       snprintf(result, MAXPATHLEN, "%s", BRLCAD_LIB_DIR);
-#else
-       snprintf(result, MAXPATHLEN, "%s", bu_brlcad_root("lib", fail_quietly));
-#endif
-       return result;
-    }
-    if (BU_STR_EQUAL(dirkey, "include")) {
-#if defined(BRLCAD_INCLUDE_DIR)
-       snprintf(result, MAXPATHLEN, "%s", BRLCAD_INCLUDE_DIR);
-#else
-       snprintf(result, MAXPATHLEN, "%s", bu_brlcad_root("include", 
fail_quietly));
-#endif
-       return result;
-    }
-    if (BU_STR_EQUAL(dirkey, "data") || BU_STR_EQUAL(dirkey, "share")) {
-#if defined(BRLCAD_DATA_DIR)
-       snprintf(result, MAXPATHLEN, "%s", BRLCAD_DATA_DIR);
-#else
-       snprintf(result, MAXPATHLEN, "%s", bu_brlcad_root("share", 
fail_quietly));
-#endif
-       return result;
-    }
-    if (BU_STR_EQUAL(dirkey, "doc")) {
-#if defined(BRLCAD_DOC_DIR)
-       snprintf(result, MAXPATHLEN, "%s", BRLCAD_DOC_DIR);
-#else
-       snprintf(result, MAXPATHLEN, "%s", bu_brlcad_root("doc", fail_quietly));
-#endif
-       return result;
-    }
-    if (BU_STR_EQUAL(dirkey, "man")) {
-#if defined(BRLCAD_MAN_DIR)
-       snprintf(result, MAXPATHLEN, "%s", BRLCAD_MAN_DIR);
-#else
-       snprintf(result, MAXPATHLEN, "%s", bu_brlcad_root("share/man", 
fail_quietly));
-#endif
-       return result;
-    }
-
-    if (!fail_quietly) {
-       snprintf(result, MAXPATHLEN, "Unknown directory key %s", dirkey);
-       return result;
-    }
-    return NULL;
-}
-
-
 /*
  * Local Variables:
  * mode: C

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to