X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/4cc7be2f1b2212541321468f58762879985a5411..refs/tags/v2.0.15:/src/main.c diff --git a/src/main.c b/src/main.c index 1fddc26..e1cfe4b 100644 --- a/src/main.c +++ b/src/main.c @@ -70,7 +70,7 @@ static char *ptypebase; char *output_dir = NULL; -static char file_sep = '-'; +char file_sep = '-'; static int signals = 0; /* number of signals */ static int set_properties = 0; /* number of named (set) properties */ @@ -101,7 +101,6 @@ static Method * finalize_handler = NULL; FILE *out = NULL; FILE *outh = NULL; FILE *outph = NULL; -FILE *devnull = NULL; gboolean no_touch = FALSE; gboolean no_touch_headers = FALSE; @@ -3095,15 +3094,7 @@ open_files(void) } - if (no_write) { - devnull = fopen ("/dev/null", "w"); - if (devnull == NULL) - error_print (GOB_ERROR, 0, "Cannot open null device"); - out = devnull; - outh = devnull; - if (outfileph != NULL) - outph = devnull; - } else { + if ( ! no_write) { out = fopen (outfile, "w"); if (out == NULL) { error_printf (GOB_ERROR, 0, @@ -3736,11 +3727,15 @@ print_includes(void) /* if we are creating a private header see if it was included */ if(outph) { - p = g_strconcat(filebase, "-private.h", NULL); + char sep[2] = {0,0}; + if (file_sep != 0) + sep[0] = file_sep; + p = g_strconcat(filebase, sep, "private.h", NULL); if( ! g_list_find_custom(include_files, p, (GCompareFunc)strcmp)) { - out_printf(out, "#include \"%s-private.h\"\n\n", - filebase); + out_printf(out, "#include \"%s%cprivate.h\"\n\n", + filebase, + file_sep); if(found_header) error_printf(GOB_WARN, 0, "Implicit private header include " @@ -4480,14 +4475,12 @@ main(int argc, char *argv[]) generate_outfiles (); - if (devnull) { - fclose (devnull); - } else { + if (out) fclose (out); + if (outh) fclose (outh); - if (outph) - fclose (outph); - } + if (outph) + fclose (outph); if (! no_write) { if (no_touch) {