Revision: 77328
http://sourceforge.net/p/brlcad/code/77328
Author: brlcad
Date: 2020-10-05 14:02:43 +0000 (Mon, 05 Oct 2020)
Log Message:
-----------
compiler warns we're assuming a gnu extension here. go through our wrapper to
ensure getcwd is called portably. means we'll never get NULL return, though,
so make sure we got a path.
Modified Paths:
--------------
brlcad/trunk/src/librt/db_open.c
Modified: brlcad/trunk/src/librt/db_open.c
===================================================================
--- brlcad/trunk/src/librt/db_open.c 2020-10-05 13:28:51 UTC (rev 77327)
+++ brlcad/trunk/src/librt/db_open.c 2020-10-05 14:02:43 UTC (rev 77328)
@@ -191,11 +191,11 @@
struct bu_vls fullpath = BU_VLS_INIT_ZERO;
bu_free((void *)argv[1], "db_open: argv[1]");
- argv[1] = getcwd((char *)NULL, (size_t)MAXPATHLEN);
+ argv[1] = bu_getcwd((char *)NULL, (size_t)MAXPATHLEN);
/* Something went wrong and we didn't get the CWD. So,
* free up any memory allocated here and return DBI_NULL */
- if (argv[1] == NULL) {
+ if (BU_STR_EQUAL(argv[1], ".") || BU_STR_EMPTY(argv[1])) {
bu_close_mapped_file(dbip->dbi_mf);
bu_free_mapped_files(0);
dbip->dbi_mf = (struct bu_mapped_file *)NULL;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits