Changeset: 889b7f119491 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=889b7f119491
Modified Files:
        monetdb5/modules/mal/language.c
Branch: Apr2019
Log Message:

Properly check for absolute path name + more efficient string copy.


diffs (20 lines):

diff --git a/monetdb5/modules/mal/language.c b/monetdb5/modules/mal/language.c
--- a/monetdb5/modules/mal/language.c
+++ b/monetdb5/modules/mal/language.c
@@ -220,14 +220,12 @@ CMDevalFile(Client cntxt, MalBlkPtr mb, 
        if (s == 0) 
                throw(MAL, "mal.evalFile", RUNTIME_FILE_NOT_FOUND "missing file 
name");
 
-       if (*s != '/') {
+       if (!MT_path_absolute(s)) {
                char *buf = GDKmalloc(strlen(monet_cwd) + strlen(s) + 2);
                if ( buf == NULL)
                        throw(MAL,"language.eval", SQLSTATE(HY001) 
MAL_MALLOC_FAIL);
 
-               strcpy(buf, monet_cwd);
-               strcat(buf, "/");
-               strcat(buf, s);
+               stpcpy(stpcpy(stpcpy(buf, monet_cwd), DIR_SEP_STR), s);
                msg = evalFile(buf, 0);
                GDKfree(buf);
        } else 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to