]> git.draconx.ca Git - gob-dx.git/blobdiff - src/main.c
Release 2.0.15
[gob-dx.git] / src / main.c
index 1fddc2658791f085a1d73a490d3a3cf8c4fd8136..e1cfe4b9313c425a70cdd14f3b30988638c2f398 100644 (file)
@@ -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) {