*** file.c.orig Tue Apr 13 10:53:09 1999 --- file.c Tue Apr 13 10:53:10 1999 *************** *** 5004,5008 **** } } else { ! int i=0, len=0, use_page_num=FALSE; if (dumpOneFilePerPage || --- 5004,5009 ---- } } else { ! int len=0, use_page_num=FALSE; ! char *psz=NULL; if (dumpOneFilePerPage || *************** *** 5020,5029 **** } len = strlen(ps_file); ! for (i=len-1; ps_file[i] != '.'; i--) ; ! if (use_page_num) { ! sprintf(&ps_file[i], "-%1d.%s", curPageNum, file_ext); } else { ! sprintf(&ps_file[i], ".%s", file_ext); } } --- 5021,5036 ---- } len = strlen(ps_file); ! if (len > 3 && strcmp(&ps_file[len-3], ".gz") == 0) { ! ps_file[len-3] = '\0'; ! len -= 3; ! } ! if ((psz=strrchr(ps_file, '.')) == NULL) { ! TgAssert(FALSE, ! "Cannot find '.' in curFileName in SetOutputFileName()", NULL); ! } if (use_page_num) { ! sprintf(psz, "-%1d.%s", curPageNum, file_ext); } else { ! sprintf(psz, ".%s", file_ext); } } *************** *** 5191,5195 **** --- 5198,5210 ---- } } else if (curFileDefined) { + int gzipped=FALSE; + strcpy(tmp_str, curFileName); + if (FileNameHasExtension(tmp_str, OBJ_FILE_TYPE, &gzipped, NULL) && + gzipped) { + char *psz=strrchr(tmp_str, '.'); + + if (psz != NULL) *psz = '\0'; + } len = strlen(tmp_str); for (i=len-1; tmp_str[i] != '.'; i--) ; *** mainloop.c.orig Tue Apr 13 10:53:15 1999 --- mainloop.c Tue Apr 13 10:53:15 1999 *************** *** 514,518 **** if ((out_fp=fopen(tmp_fname, "w")) == NULL) { sprintf(gszMsgBox, "Fail to create temporary file '%s'.", tmp_fname); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); return NULL; } --- 514,522 ---- if ((out_fp=fopen(tmp_fname, "w")) == NULL) { sprintf(gszMsgBox, "Fail to create temporary file '%s'.", tmp_fname); ! if (PRTGIF) { ! fprintf(stderr, "%s\n", gszMsgBox); ! } else { ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! } return NULL; } *************** *** 530,538 **** } sprintf(gszMsgBox, "Executing '%s'...", gunzipCmd); ! SetStringStatus(gszMsgBox); ! if ((pfp=(FILE*)popen(cmd, "r")) == NULL) { sprintf(gszMsgBox, "Cannot execute '%s'.", cmd); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); fclose(out_fp); unlink(tmp_fname); --- 534,549 ---- } sprintf(gszMsgBox, "Executing '%s'...", gunzipCmd); ! if (PRTGIF) { ! fprintf(stderr, "%s\n", gszMsgBox); ! } else { ! SetStringStatus(gszMsgBox); ! } if ((pfp=(FILE*)popen(cmd, "r")) == NULL) { sprintf(gszMsgBox, "Cannot execute '%s'.", cmd); ! if (PRTGIF) { ! fprintf(stderr, "%s\n", gszMsgBox); ! } else { ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! } fclose(out_fp); unlink(tmp_fname); *** setup.c.orig Tue Apr 13 10:53:16 1999 --- setup.c Tue Apr 13 10:53:17 1999 *************** *** 1726,1730 **** InitMiniLines(); ! if (PRTGIF && !cmdLineOpenDisplay) { return; } --- 1726,1730 ---- InitMiniLines(); ! if (PRTGIF) { return; } *** tgif.c.orig Tue Apr 13 10:53:19 1999 --- tgif.c Tue Apr 13 10:53:19 1999 *************** *** 145,148 **** --- 145,149 ---- struct ObjRec *obj_ptr=NULL; char full_name[MAXPATHLENGTH+1], tmp_filename[MAXPATHLENGTH+1]; + char gzipped_fname[MAXPATHLENGTH+1]; int read_status, obj_file=TRUE; FILE *fp=NULL; *************** *** 149,154 **** int tmp_linenum=0, gzipped=FALSE; if (FileNameHasExtension(FileName, OBJ_FILE_TYPE, &gzipped, NULL)) { ! strcpy(full_name, FileName); } else if (FileNameHasExtension(FileName, SYM_FILE_TYPE, NULL, NULL)) { strcpy(full_name, FileName); --- 150,175 ---- int tmp_linenum=0, gzipped=FALSE; + *gzipped_fname = '\0'; if (FileNameHasExtension(FileName, OBJ_FILE_TYPE, &gzipped, NULL)) { ! if (gzipped) { ! if (cmdLineOpenDisplay) { ! char *tmp_fname=NULL; ! ! if ((tmp_fname=GunzipFileIntoTemp(FileName)) == NULL) { ! return FALSE; ! } else { ! strcpy(gzipped_fname, FileName); ! strcpy(full_name, tmp_fname); ! free(tmp_fname); ! } ! } else { ! fprintf(stderr, "%s.\n%s.\n", ! "Does not know how to run gunzip", ! "Please specify '-display $DISPLAY' on the command line"); ! return FALSE; ! } ! } else { ! strcpy(full_name, FileName); ! } } else if (FileNameHasExtension(FileName, SYM_FILE_TYPE, NULL, NULL)) { strcpy(full_name, FileName); *************** *** 162,165 **** --- 183,187 ---- if ((fp=fopen(full_name, "r")) == NULL) { fprintf(stderr, "Cannot open '%s'.\n", full_name); + if (*gzipped_fname != '\0') unlink(full_name); return FALSE; } *************** *** 188,193 **** --- 210,220 ---- fprintf(stderr, "File version too large (=%1d). Processing aborted!\n", fileVersion); + if (*gzipped_fname != '\0') unlink(full_name); return FALSE; } + if (*gzipped_fname != '\0') { + unlink(full_name); + strcpy(full_name, gzipped_fname); + } if (cmdLineOpenDisplay) { char file_path[MAXPATHLENGTH+1]; *** Imakefile.orig Tue Apr 13 10:53:21 1999 --- Imakefile Tue Apr 13 10:53:21 1999 *************** *** 53,57 **** $(MOREDEFINES) ! TGIFVERSION = 4.1.6 XCOMM Things to try to add to the DEFINES line above: --- 53,57 ---- $(MOREDEFINES) ! TGIFVERSION = 4.1.7 XCOMM Things to try to add to the DEFINES line above: *** HISTORY.orig Tue Apr 13 10:53:22 1999 --- HISTORY Tue Apr 13 10:53:22 1999 *************** *** 1,2 **** --- 1,7 ---- + -----------------------> tgif-4.1.6 => tgif-4.1.7 <----------------------- + Here's a short list of added features/bug fixes. + + 1) Fix bugs in using the wrong export file name when the obj file is gzipped. + -----------------------> tgif-4.1.5 => tgif-4.1.6 <----------------------- Here's a short list of added features/bug fixes.