Changeset: e2bb5ac2e970 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e2bb5ac2e970
Modified Files:
        MonetDB5/src/mal/mal_linker.mx
Branch: default
Log Message:

merge bug fix from Jun2010


diffs (38 lines):

diff -r 4b8403864365 -r e2bb5ac2e970 MonetDB5/src/mal/mal_linker.mx
--- a/MonetDB5/src/mal/mal_linker.mx    Thu May 27 22:12:16 2010 +0200
+++ b/MonetDB5/src/mal/mal_linker.mx    Fri May 28 00:00:45 2010 +0200
@@ -383,16 +383,16 @@
                                if (strcmp(e->d_name, "..") == 0 || 
strcmp(e->d_name, ".") == 0)
                                        continue;
                                if (strcmp(e->d_name + strlen(e->d_name) - 
strlen(ext), ext) == 0) {
-                                       strs[lasts] = 
GDKmalloc(strlen(fullname) +
-                                                       sizeof(DIR_SEP) + 
strlen(e->d_name) + 1);
+                                       strs[lasts] = 
GDKmalloc(strlen(fullname) + sizeof(DIR_SEP)
+                                                       + strlen(e->d_name) + 
sizeof(PATH_SEP) + 1);
                                        if (strs[lasts] == NULL) {
                                                while (lasts >= 0)
                                                        GDKfree(strs[lasts--]);
                                                GDKfree(fullname);
                                                return NULL;
                                        }
-                                       sprintf(strs[lasts], "%s%c%s",
-                                                       fullname, DIR_SEP, 
GDKstrdup(e->d_name));
+                                       sprintf(strs[lasts], "%s%c%s%c",
+                                                       fullname, DIR_SEP, 
GDKstrdup(e->d_name), PATH_SEP);
                                        lasts++;
                                }
                                if (lasts >= MAXMULTISCRIPT)
@@ -423,9 +423,10 @@
                fullname = GDKrealloc(fullname, i);
                i = 0;
                for (c = 0; c < lasts; c++) {
-                       strcpy(fullname + i, strs[c]);
-                       i += strlen(strs[c]);
-                       fullname[i++] = PATH_SEP;
+                       if (strstr(fullname, strs[c]) == NULL) {
+                               strcpy(fullname + i, strs[c]);
+                               i += strlen(strs[c]);
+                       }
                        GDKfree(strs[c]);
                }
                fullname[i - 1] = '\0';
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to