]> granicus.if.org Git - multimarkdown/commitdiff
TESTING: Working on Travis
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Fri, 21 Jul 2017 15:15:38 +0000 (11:15 -0400)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Fri, 21 Jul 2017 15:15:38 +0000 (11:15 -0400)
Sources/multimarkdown/main.c

index e606a37bbd313347984359059a0cb9b1233ae0cf..bed78e59f929bf15537fedc19d0286438899df4b 100644 (file)
@@ -476,29 +476,30 @@ int main(int argc, char** argv) {
 
                char * folder = NULL;
 
-               if (a_file->count == 1) {
-                       folder = dirname((char *) a_file->filename[0]);
-               }
-
                if ((extensions & EXT_TRANSCLUDE) && (a_file->count == 1)) {
                        // Perform transclusion(s)
             
             // Convert to absolute path for first file to enable proper path resolution
-
 #ifdef PATH_MAX
             char absolute[PATH_MAX + 1];
             realpath(a_file->filename[0], absolute);
             fprintf(stderr, "A->'%s'->'%s'\n",a_file->filename[0],absolute);
+                       folder = dirname((char *) a_file->filename[0]);
             mmd_transclude_source(buffer, folder, absolute, format, NULL, NULL);
 #else
             char * absolute = realpath(a_file->filename[0], NULL);
             fprintf(stderr, "B->'%s'->'%s'\n",a_file->filename[0],absolute);
+                       folder = dirname((char *) a_file->filename[0]);
             mmd_transclude_source(buffer, folder, absolute, format, NULL, NULL);
             free(absolute);
 #endif
                        // Don't free folder -- owned by dirname
                }
 
+               if (a_file->count == 1) {
+                       folder = dirname((char *) a_file->filename[0]);
+               }
+
                // Perform block level CriticMarkup?
                if (extensions & EXT_CRITIC_ACCEPT) {
                        mmd_critic_markup_accept(buffer);