If I choose to print to file from the mcs manager, xfprint will produce an empty file. Even worse, if I change the options to [x] print headers then not even the 0 bytes file is produced. Using a2ps from terminal works ok. On sending to cups printer, I get error: "client/error bad request". On sending to lpd printer (really cups version of lpr), dialog indicating that file is being printed appears, but nothing is sent to printer :-( This is gentoo-linux, GNU a2ps 4.13c, cups 1.1.20
i don't forget, just need to time to take a look into it
I've started to look into the problem. So far, it seems that the argv[1] is not placed in the ifile variable, thus there is no input file and no output: (gdb) set args README (gdb) break printdlg.c:238 Breakpoint 1 at 0x804f480: file printdlg.c, line 238. (gdb) run Breakpoint 1, print (dlg=0x8077d18, ifile=0x0, settings=0x82c4560) at printdlg.c:238 238 ret = !xfprint_filterlist_execute (filters, STDIN_FILENO, output, (gdb) print *ifile Cannot access memory at address 0x0 (gdb)
Further tracking: Breakpoint 3, print_dialog_run (ifile=0x8077b40 "README") at printdlg.c:164 164 if (g_str_has_prefix (ifile, "file://")) 167 gchar *temp = NULL; 169 temp = g_strdup_printf("file://%s", ifile); 170 decoded_ifile = g_filename_from_uri (temp, NULL, NULL); (gdb) print temp $9 = (gchar *) 0x82c79b8 "file://README" 171 g_free (temp); 174 if (!print (dlg, decoded_ifile, settings)){ (gdb) print decoded_ifile $11 = (gchar *) 0x0 Apparently g_filename_from_uri() is not working as intended. Error can be one of: typedef enum { G_CONVERT_ERROR_NO_CONVERSION, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, G_CONVERT_ERROR_FAILED, G_CONVERT_ERROR_PARTIAL_INPUT, G_CONVERT_ERROR_BAD_URI, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH } GConvertError; Looks like G_CONVERT_ERROR_NOT_ABSOLUTE_PATH... Lets see... (gdb) set args /usr/home/common/CVS/lunar/HEAD/xfce4/xfprint/README (gdb) run Breakpoint 3, print_dialog_run ( ifile=0x8078758 "/usr/home/common/CVS/lunar/HEAD/xfce4/xfprint/README") at printdlg.c:164 164 if (g_str_has_prefix (ifile, "file://")) 167 gchar *temp = NULL; 169 temp = g_strdup_printf("file://%s", ifile); 170 decoded_ifile = g_filename_from_uri (temp, NULL, NULL); 171 g_free (temp); (gdb) print decoded_ifile $12 = ( gchar *) 0x82ce8c0 "/usr/home/common/CVS/lunar/HEAD/xfce4/xfprint/README" Yeah. Relative paths are not supported. This can be fixed by prepending the programs work dir (g_get_w g_path_is_absolute (const gchar *file_name); if (!g_path_is_absolute(ifile)) { gchar *w=g_get_current_dir (); temp = g_strdup_printf("file://%s%c%s", w,_DIR_SEPARATOR,ifile); g_free(w); } else temp = g_strdup_printf("file://%s", ifile); Although if the decoded file name is what we are after, I don't see why we have to convert to uri and then convert back... Anyways, even though the above is an identified and fixable bug, no output file is produced, so there seems to be another problem down the line :-(
should be fixed in CVS now, reopen if you still have problems