*** eps.c.orig Thu Jan 28 10:12:57 1999 --- eps.c Thu Jan 28 10:12:57 1999 *************** *** 80,90 **** void InitEPS() { ! char *c_ptr; - stripEPSComments = TRUE; - if ((c_ptr=XGetDefault(mainDisplay,TOOL_NAME,"StripEPSComments")) != NULL && - UtilStrICmp(c_ptr, "false") == 0) { - stripEPSComments = FALSE; - } if ((c_ptr=XGetDefault(mainDisplay,TOOL_NAME,"ForceClearAfterEPS")) != NULL) { --- 80,85 ---- void InitEPS() { ! char *c_ptr=NULL; if ((c_ptr=XGetDefault(mainDisplay,TOOL_NAME,"ForceClearAfterEPS")) != NULL) { *************** *** 143,147 **** { CleanUpLines(); ! stripEPSComments = TRUE; } --- 138,142 ---- { CleanUpLines(); ! stripEPSComments = FALSE; } *** exec.c.orig Thu Jan 28 10:12:58 1999 --- exec.c Thu Jan 28 10:12:59 1999 *************** *** 575,579 **** static ! char *GetToken(inbuf, outbuf, tok_type) char *inbuf, *outbuf; int *tok_type; --- 575,579 ---- static ! char *GetToken(inbuf, outbuf, obuf_sz, tok_type) char *inbuf, *outbuf; int *tok_type; *************** *** 584,587 **** --- 584,588 ---- { register char *c_ptr, *obuf_ptr=outbuf; + int obuf_index=0; *tok_type = TOK_INVALID; *************** *** 617,621 **** } else { strcpy(obuf_ptr,"("); ! *tok_type=TOK_LEFT_P; gnSeenLeftParan = TRUE; return(&inbuf[1]); --- 618,622 ---- } else { strcpy(obuf_ptr,"("); ! *tok_type = TOK_LEFT_P; gnSeenLeftParan = TRUE; return(&inbuf[1]); *************** *** 626,630 **** } else { strcpy(obuf_ptr,")"); ! *tok_type=TOK_RIGHT_P; return(&inbuf[1]); } --- 627,631 ---- } else { strcpy(obuf_ptr,")"); ! *tok_type = TOK_RIGHT_P; return(&inbuf[1]); } *************** *** 650,664 **** */ while (*c_ptr != '\0') { if (*c_ptr == '$' && c_ptr[1] == '(') { ! *obuf_ptr++ = *c_ptr++; ! *obuf_ptr++ = *c_ptr++; ! while (*c_ptr != '\0' && *c_ptr != ')') *obuf_ptr++ = *c_ptr++; if (*c_ptr == '\0') return NULL; } else if (*c_ptr == '"' || *c_ptr == '\'') { ! char *tmp_c_ptr; ! *obuf_ptr++ = *c_ptr; for (tmp_c_ptr=(&c_ptr[1]); *tmp_c_ptr!=(*c_ptr) && *tmp_c_ptr!='\0'; tmp_c_ptr++) { switch (*tmp_c_ptr) { case '\\': --- 651,677 ---- */ while (*c_ptr != '\0') { + int max_obuf_index=0; + if (*c_ptr == '$' && c_ptr[1] == '(') { ! max_obuf_index = (obuf_sz-3); ! if (obuf_index >= max_obuf_index) return NULL; ! *obuf_ptr++ = (*c_ptr++); ! *obuf_ptr++ = (*c_ptr++); ! obuf_index += 2; ! max_obuf_index++; ! while (*c_ptr != '\0' && *c_ptr != ')') { ! if (obuf_index++ >= max_obuf_index) return NULL; ! *obuf_ptr++ = *c_ptr++; ! } if (*c_ptr == '\0') return NULL; } else if (*c_ptr == '"' || *c_ptr == '\'') { ! char *tmp_c_ptr=NULL; ! max_obuf_index = (obuf_sz-2); ! if (obuf_index++ >= max_obuf_index) return NULL; ! *obuf_ptr++ = (*c_ptr); for (tmp_c_ptr=(&c_ptr[1]); *tmp_c_ptr!=(*c_ptr) && *tmp_c_ptr!='\0'; tmp_c_ptr++) { + if (obuf_index++ >= max_obuf_index) return NULL; switch (*tmp_c_ptr) { case '\\': *************** *** 675,680 **** --- 688,695 ---- if (*tmp_c_ptr == '\0') return NULL; c_ptr = tmp_c_ptr; + if (obuf_index++ >= max_obuf_index) return NULL; *obuf_ptr++ = *c_ptr++; } else { + if (obuf_index++ >= obuf_sz-2) return NULL; *obuf_ptr++ = *c_ptr++; } *************** *** 6835,6840 **** struct ExecInfoRec *pei; int i, tok_type, rc=TRUE, func_argc=0, need_raw_argv=FALSE; ! char buf[MAXSTRING+1], **argv=NULL, **raw_argv=NULL; ! char *c_ptr=GetToken(cmd_ptr, buf, &tok_type); if (c_ptr == NULL) return NULL; --- 6850,6855 ---- struct ExecInfoRec *pei; int i, tok_type, rc=TRUE, func_argc=0, need_raw_argv=FALSE; ! char buf[MAXSTRING<<2], **argv=NULL, **raw_argv=NULL; ! char *c_ptr=GetToken(cmd_ptr, buf, sizeof(buf), &tok_type); if (c_ptr == NULL) return NULL; *************** *** 6880,6884 **** } for (i=0; i < func_argc; i++) { ! if ((c_ptr=GetToken(c_ptr, buf, &tok_type)) == NULL || tok_type == TOK_EMPTY) { BadCmd(pei->func_name); --- 6895,6899 ---- } for (i=0; i < func_argc; i++) { ! if ((c_ptr=GetToken(c_ptr, buf, sizeof(buf), &tok_type)) == NULL || tok_type == TOK_EMPTY) { BadCmd(pei->func_name); *************** *** 6896,6900 **** } } ! if ((c_ptr=GetToken(c_ptr, buf, &tok_type)) == NULL || tok_type == TOK_EMPTY) { BadCmd(pei->func_name); --- 6911,6915 ---- } } ! if ((c_ptr=GetToken(c_ptr, buf, sizeof(buf), &tok_type)) == NULL || tok_type == TOK_EMPTY) { BadCmd(pei->func_name); *************** *** 6920,6924 **** } if (func_argc == 0) { ! if ((c_ptr=GetToken(c_ptr, buf, &tok_type)) == NULL || tok_type == TOK_EMPTY) { BadCmd(pei->func_name); --- 6935,6939 ---- } if (func_argc == 0) { ! if ((c_ptr=GetToken(c_ptr, buf, sizeof(buf), &tok_type)) == NULL || tok_type == TOK_EMPTY) { BadCmd(pei->func_name); *************** *** 6930,6934 **** } } ! if ((c_ptr=GetToken(c_ptr, buf, &tok_type)) == NULL || tok_type == TOK_EMPTY) { BadCmd(pei->func_name); --- 6945,6949 ---- } } ! if ((c_ptr=GetToken(c_ptr, buf, sizeof(buf), &tok_type)) == NULL || tok_type == TOK_EMPTY) { BadCmd(pei->func_name); *************** *** 6970,6974 **** rc = FALSE; } else if (*cmd_ptr != '\0') { ! char buf[MAXSTRING+1]; if (execNavigateBack) { --- 6985,6989 ---- rc = FALSE; } else if (*cmd_ptr != '\0') { ! char buf[MAXSTRING<<2]; if (execNavigateBack) { *************** *** 6978,6982 **** } else if (OnlyBlanksLeft(cmd_ptr)) { break; ! } else if ((cmd_ptr=GetToken(cmd_ptr, buf, &tok_type)) == NULL) { rc = FALSE; } else if (tok_type != TOK_SEMI) { --- 6993,6998 ---- } else if (OnlyBlanksLeft(cmd_ptr)) { break; ! } else if ((cmd_ptr=GetToken(cmd_ptr, buf, sizeof(buf), &tok_type)) == ! NULL) { rc = FALSE; } else if (tok_type != TOK_SEMI) { *** file.c.orig Thu Jan 28 10:13:05 1999 --- file.c Thu Jan 28 10:13:05 1999 *************** *** 293,304 **** *ppszEnd = (&psz[1]); } else { ! sprintf(gszMsgBox, "Malformed PostScript input (%s):\n\n...%s\n\n%s.", ! read_fname, pszStart, "Please try printing again"); ! if (PRTGIF) { ! fprintf(stderr, "%s\n", gszMsgBox); ! } else { ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! } ! dontCondense = TRUE; } } else { --- 293,297 ---- *ppszEnd = (&psz[1]); } else { ! /* no problem - Adobe Illustrator 6.0 does this a lot */ } } else { *************** *** 324,327 **** --- 317,321 ---- int previewing=FALSE, begin_preview_len=strlen("%%BeginPreview:"); + if (stripSimpleComments == INVALID) stripSimpleComments = FALSE; *gszResidual = '\0'; gnResidualLen = 0; *************** *** 4515,4524 **** } if (stripSimpleComments == INVALID) { ! stripSimpleComments = TRUE; if (!PRTGIF || cmdLineOpenDisplay) { if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "StripCondensedPSComments")) != NULL && ! UtilStrICmp(c_ptr, "false") == 0) { ! stripSimpleComments = FALSE; } } --- 4509,4525 ---- } if (stripSimpleComments == INVALID) { ! stripSimpleComments = FALSE; if (!PRTGIF || cmdLineOpenDisplay) { if ((c_ptr=XGetDefault(mainDisplay, TOOL_NAME, "StripCondensedPSComments")) != NULL && ! UtilStrICmp(c_ptr, "false") != 0) { ! static int shown_once=FALSE; ! ! if (!shown_once) { ! sprintf(gszMsgBox, "Obsoleted %s.%s used. Ignored.", ! TOOL_NAME, "StripCondensedPSComments"); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); ! shown_once = TRUE; ! } } } *** mainloop.c.orig Thu Jan 28 10:13:10 1999 --- mainloop.c Thu Jan 28 10:13:10 1999 *************** *** 724,733 **** } if (read_status == INVALID) { ! sprintf(gszMsgBox, "File version too large (=%1d). Load aborted!", ! fileVersion); ! Msg(gszMsgBox); ! sprintf(gszMsgBox, " You may need a more recent version of %s", ! TOOL_NAME); ! Msg(gszMsgBox); } else { CheckFileAttrsInLoad(); --- 724,732 ---- } if (read_status == INVALID) { ! sprintf(gszMsgBox, "%s (=%1d) %s.\n\n%s!\n\n%s %s. %s .", ! "File version", fileVersion, "too large", ! "Load aborted", "You may need a more recent version of", ! TOOL_NAME, "Please check", homePageURL); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); } else { CheckFileAttrsInLoad(); *** names.c.orig Thu Jan 28 10:13:12 1999 --- names.c Thu Jan 28 10:13:12 1999 *************** *** 517,520 **** --- 517,521 ---- *curSymDir = '\0'; strcpy(curDir, bootDir); + strcpy(curLocalDir, bootDir); strcpy(curImportDir, bootDir); *************** *** 903,907 **** if ((index=DirNames(MsgStr,OBJ_FILE_EXT,SelStr,&just_set_dir)) == INVALID) { if (just_set_dir) { ! strcpy(curDir, SelStr); BuildDirList(); if (strcmp(saved_cur_dir, curDir) != 0 && DirInSymPath(".")) { --- 904,912 ---- if ((index=DirNames(MsgStr,OBJ_FILE_EXT,SelStr,&just_set_dir)) == INVALID) { if (just_set_dir) { ! if (curDirIsLocal) { ! strcpy(curDir, SelStr); ! } else { ! strcpy(curLocalDir, SelStr); ! } BuildDirList(); if (strcmp(saved_cur_dir, curDir) != 0 && DirInSymPath(".")) { *************** *** 945,949 **** if ((index=DirNames(MsgStr,NULL,SelStr,&just_set_dir)) == INVALID) { if (just_set_dir) { ! strcpy(curDir, SelStr); BuildDirList(); if (strcmp(saved_cur_dir, curDir) != 0 && DirInSymPath(".")) { --- 950,958 ---- if ((index=DirNames(MsgStr,NULL,SelStr,&just_set_dir)) == INVALID) { if (just_set_dir) { ! if (curDirIsLocal) { ! strcpy(curDir, SelStr); ! } else { ! strcpy(curLocalDir, SelStr); ! } BuildDirList(); if (strcmp(saved_cur_dir, curDir) != 0 && DirInSymPath(".")) { *** special.c.orig Thu Jan 28 10:13:13 1999 --- special.c Thu Jan 28 10:13:13 1999 *************** *** 75,78 **** --- 75,79 ---- #endif /* _TGIF_WB */ #include "util.e" + #include "version.e" int placingTopObj=FALSE; *************** *** 194,201 **** obj_ptr = NULL; if (read_status == INVALID) { ! sprintf(gszMsgBox, ! "File version too large (=%1d).\n\nRead symbol aborted!", ! fileVersion); ! Msg(gszMsgBox); } else if (FileType == PIN_FILE_TYPE && sym_count == 1) { obj_ptr = CreatePinObj(obj_ptr1, obj_ptr2, sym_count); --- 195,203 ---- obj_ptr = NULL; if (read_status == INVALID) { ! sprintf(gszMsgBox, "%s (=%1d) %s.\n\n%s!\n\n%s %s. %s .", ! "File version", fileVersion, "too large", ! "Read symbol aborted", "You may need a more recent version of", ! TOOL_NAME, "Please check", homePageURL); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); } else if (FileType == PIN_FILE_TYPE && sym_count == 1) { obj_ptr = CreatePinObj(obj_ptr1, obj_ptr2, sym_count); *** stk.c.orig Thu Jan 28 10:13:15 1999 --- stk.c Thu Jan 28 10:13:15 1999 *************** *** 68,71 **** --- 68,72 ---- #include "text.e" #include "util.e" + #include "version.e" struct ObjRec *tgifObj=NULL; *************** *** 343,349 **** if (read_status == INVALID) { ! sprintf(gszMsgBox, "File version too large (=%1d). Push aborted!", ! fileVersion); ! Msg(gszMsgBox); DrawPaperBoundary(drawWindow); RedrawGridLines(drawWindow); --- 344,352 ---- if (read_status == INVALID) { ! sprintf(gszMsgBox, "%s (=%1d) %s.\n\n%s!\n\n%s %s. %s .", ! "File version", fileVersion, "too large", ! "Push aborted", "You may need a more recent version of", ! TOOL_NAME, "Please check", homePageURL); ! MsgBox(gszMsgBox, TOOL_NAME, INFO_MB); DrawPaperBoundary(drawWindow); RedrawGridLines(drawWindow); *** xbitmap.c.orig Thu Jan 28 10:13:17 1999 --- xbitmap.c Thu Jan 28 10:13:17 1999 *************** *** 77,81 **** int askForXBmSpec=FALSE; ! int stripEPSComments=TRUE; int saveEPSLines=FALSE; --- 77,81 ---- int askForXBmSpec=FALSE; ! int stripEPSComments=FALSE; int saveEPSLines=FALSE; *************** *** 239,246 **** askForXBmSpec = TRUE; } ! stripEPSComments = TRUE; if ((c_ptr=XGetDefault(mainDisplay,TOOL_NAME,"StripEPSComments")) != NULL && ! UtilStrICmp(c_ptr, "false") == 0) { ! stripEPSComments = FALSE; } xpmOutputVersion = 1; --- 239,247 ---- askForXBmSpec = TRUE; } ! stripEPSComments = FALSE; if ((c_ptr=XGetDefault(mainDisplay,TOOL_NAME,"StripEPSComments")) != NULL && ! UtilStrICmp(c_ptr, "false") != 0) { ! fprintf(stderr, "Obsoleted %s.%s used. Ignored.\n", ! TOOL_NAME, "StripEPSComments"); } xpmOutputVersion = 1; *** patchlvl.h.orig Thu Jan 28 10:13:19 1999 --- patchlvl.h Thu Jan 28 10:13:20 1999 *************** *** 35,39 **** #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 10 #endif /*_TGIF_PATCHLEVEL_H_*/ --- 35,39 ---- #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 11 #endif /*_TGIF_PATCHLEVEL_H_*/ *** Imakefile.orig Thu Jan 28 10:13:21 1999 --- Imakefile Thu Jan 28 10:13:21 1999 *************** *** 53,57 **** $(MOREDEFINES) ! TGIFVERSION = 4.0.10 XCOMM Things to try to add to the DEFINES line above: --- 53,57 ---- $(MOREDEFINES) ! TGIFVERSION = 4.0.11 XCOMM Things to try to add to the DEFINES line above: *** tgif.man.orig Thu Jan 28 10:13:22 1999 --- tgif.man Thu Jan 28 10:13:22 1999 *************** *** 9,13 **** .\" .\" ! .TH TGIF n "Version 4.0 Patchlevel 2 and Above" "Tgif" .\" .SH NAME --- 9,13 ---- .\" .\" ! .TH TGIF n "Version 4.0 Patchlevel 11 and Above" "Tgif" .\" .SH NAME *************** *** 261,266 **** .TP .B -pepsc ! Preserve EPS Comment. Using option has the same effect as ! setting the Tgif.StripEPSComment X default to false. .TP .B -dontcondense --- 261,266 ---- .TP .B -pepsc ! Preserve EPS Comment. This command line option is obsoleted since ! EPS comments are always preserved starting from tgif-4.0.11. .TP .B -dontcondense *************** *** 267,272 **** Preserve EPS Comment. Using option has the same effect as setting the Tgif.DontUseShortHandPS and Tgif.DontCondensePSFile ! X defaults to true and Tgif.StripCondensedPSComments X default ! to false. .TP .B -bop_hook \fRand\fB -eop_hook --- 267,271 ---- Preserve EPS Comment. Using option has the same effect as setting the Tgif.DontUseShortHandPS and Tgif.DontCondensePSFile ! X defaults to true. .TP .B -bop_hook \fRand\fB -eop_hook *************** *** 3122,3130 **** The default is false. .TP ! .I Tgif.StripEPSComments: [true,false] ! If set to ``true'', lines that start with '%' in an Encapsulated ! PostScript file will be stripped when the file is imported (except ! the first line of the file). ! The default is true. .TP .I Tgif.GuessXPmBgColor: [true,false] --- 3121,3128 ---- The default is false. .TP ! .I Tgif.StripEPSComments: (obsolete) ! This X default is obsolete in tgif-4.0.11 ! because it turns out that it's not always ! okay to strip PS comments (it should always be set to false). .TP .I Tgif.GuessXPmBgColor: [true,false] *************** *** 3928,3935 **** The default is false. .TP ! .I Tgif.StripCondensedPSComments: [true,false] ! If tgif is generating condensed PS/EPS files, setting this ! X default to ``false'' will preserve comments. ! The default is true. .TP .I Tgif.PdfFileExtension: STRING --- 3926,3933 ---- The default is false. .TP ! .I Tgif.StripCondensedPSComments: (obsolete) ! This X default is obsolete in tgif-4.0.11 ! because it turns out that it's not always ! okay to strip PS comments (it should always be set to false). .TP .I Tgif.PdfFileExtension: STRING *** HISTORY.orig Thu Jan 28 10:13:26 1999 --- HISTORY Thu Jan 28 10:13:26 1999 *************** *** 1,2 **** --- 1,11 ---- + -----------------------> tgif-4.0.10 => tgif-4.0.11 <----------------------- + Here's a short list of added features/bug fixes. + + 1) Obsolete Tgif.StripEPSComments and Tgif.StripCondensedPSComments + X defaults. Turns out that it's not always okay to strip PostScript + comments (an Adobe Illustrator 6.0 generated EPS file may have data + that looks like a PostScript comment). So these values should alway + be false. + -----------------------> tgif-4.0.9 => tgif-4.0.10 <----------------------- Here's a short list of added features/bug fixes. *** tgif.Xdefaults.orig Thu Jan 28 10:13:27 1999 --- tgif.Xdefaults Thu Jan 28 10:13:27 1999 *************** *** 160,164 **** Tgif.AskForXBmSpec: false Tgif.AskForXPmSpec: false ! Tgif.StripEPSComments: true Tgif.GuessXPmBgColor: false Tgif.XPmOutputVersion: 1 --- 160,164 ---- Tgif.AskForXBmSpec: false Tgif.AskForXPmSpec: false ! !Tgif.StripEPSComments: false <-- obsolete!!! Tgif.GuessXPmBgColor: false Tgif.XPmOutputVersion: 1 *************** *** 323,327 **** Tgif.ShowFontSizeInPoints: false Tgif.DontCondensePSFile: false ! Tgif.StripCondensedPSComments: false Tgif.PdfFileExtension: pdf Tgif.PsToPdf: ps2pdf %s --- 323,327 ---- Tgif.ShowFontSizeInPoints: false Tgif.DontCondensePSFile: false ! Tgif.StripCondensedPSComments: false <-- obsolete!!! Tgif.PdfFileExtension: pdf Tgif.PsToPdf: ps2pdf %s *** make.comdep.orig Thu Jan 28 10:13:29 1999 --- make.comdep Thu Jan 28 10:13:29 1999 *************** *** 353,357 **** mainloop.e mark.e menu.e menuinfo.e miniline.e msg.e move.e \ names.e obj.e page.e raster.e remote.e ruler.e scroll.e \ ! select.e setup.e special.e stk.e text.e util.e spline$(O) : tgifdefs.h const.h tgif_dbg.h types.h dialog.e msg.e poly.e \ polygon.e ps.e raster.e rect.e setup.e spline.e --- 353,357 ---- mainloop.e mark.e menu.e menuinfo.e miniline.e msg.e move.e \ names.e obj.e page.e raster.e remote.e ruler.e scroll.e \ ! select.e setup.e special.e stk.e text.e util.e version.e spline$(O) : tgifdefs.h const.h tgif_dbg.h types.h dialog.e msg.e poly.e \ polygon.e ps.e raster.e rect.e setup.e spline.e *************** *** 360,364 **** dup.e file.e font.e grid.e mainmenu.e mark.e menu.e msg.e \ names.e navigate.e obj.e page.e pattern.e raster.e rect.e \ ! ruler.e scroll.e select.e setup.e stk.e text.e util.e stream$(O) : tgifdefs.h const.h tgif_dbg.h types.h dialog.e drawing.e \ file.e http.e import.e menu.e move.e msg.e obj.e remote.e \ --- 360,365 ---- dup.e file.e font.e grid.e mainmenu.e mark.e menu.e msg.e \ names.e navigate.e obj.e page.e pattern.e raster.e rect.e \ ! ruler.e scroll.e select.e setup.e stk.e text.e util.e \ ! version.e stream$(O) : tgifdefs.h const.h tgif_dbg.h types.h dialog.e drawing.e \ file.e http.e import.e menu.e move.e msg.e obj.e remote.e \