Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 88742 | Differences between
and this patch

Collapse All | Expand All

(-)xv-3.10a.orig/xvbrowse.c (+14 lines)
Lines 4950-4956 Link Here
4950
4950
4951
    if (dstdir) {
4951
    if (dstdir) {
4952
#ifndef VMS  /* we don't delete directories in VMS */
4952
#ifndef VMS  /* we don't delete directories in VMS */
4953
      char *x, *y, *name;
4954
4955
      x = (char *) malloc((5 * strlen(dst))+3);*x++ = 0x27;
4956
      if (!x)
4957
        FatalError("malloc failure in xvbrowse.c moveFile");
4958
      name = x;
4959
      *x++ = 0x27;
4960
      for (y = dst; *y; ++y) {
4961
	if (0x27 == *y) {
4962
	  strcpy(x, "'\"'\"'");
4963
	  x += strlen(x);
4964
	} else *x++ = *y;
4965
      }
4953
      sprintf(buf, "rm -rf %s", dst);
4966
      sprintf(buf, "rm -rf %s", dst);
4967
      free(name);
4954
      if (system(buf)) {     /* okay, so it's cheating... */
4968
      if (system(buf)) {     /* okay, so it's cheating... */
4955
	SetISTR(ISTR_WARNING, "Unable to remove directory %s", dst);
4969
	SetISTR(ISTR_WARNING, "Unable to remove directory %s", dst);
4956
	return 1;
4970
	return 1;
(-)xv-3.10a.orig/xvpds.c (-69 / +73 lines)
Lines 77-84 Link Here
77
 * Huffman-encoded, and the encoding histogram follows the ASCII headers.
77
 * Huffman-encoded, and the encoding histogram follows the ASCII headers.
78
 * To decode these, we use a slightly modified version of "vdcomp.c" from the
78
 * To decode these, we use a slightly modified version of "vdcomp.c" from the
79
 * NASA Viking CD-ROMS.  For xv to work, you need to have vdcomp compiled
79
 * NASA Viking CD-ROMS.  For xv to work, you need to have vdcomp compiled
80
 * and in your search path.  vdcomp.c should be included with this
80
 * and in your search path.  vdcomp.c should be included with this distribution.
81
distribution.
82
 *
81
 *
83
 * I've heard that newer discs have FITS images on them.  If they do, support
82
 * I've heard that newer discs have FITS images on them.  If they do, support
84
 * for them will be added when I get one.  Until then, you can use fitstopgm.
83
 * for them will be added when I get one.  Until then, you can use fitstopgm.
Lines 129-155 Link Here
129
128
130
/* This is arbitrary.  Everything I've seen so far fits in 50 chars */
129
/* This is arbitrary.  Everything I've seen so far fits in 50 chars */
131
#define COMMENTSIZE	50
130
#define COMMENTSIZE	50
131
#define INOTESIZE	1000
132
132
133
133
134
static int	lastwasinote = FALSE;
134
static int	lastwasinote = FALSE;
135
static char	scanbuff         [MAX_SIZE],
135
static char	scanbuff         [MAX_SIZE+1],
136
                rtbuff         [RTBUFFSIZE],
136
                rtbuff         [RTBUFFSIZE+1],
137
		inote	   [20*COMMENTSIZE],
137
		inote	        [INOTESIZE+1],
138
                infobuff      [COMMENTSIZE],
138
                infobuff      [COMMENTSIZE+1],
139
		spacecraft    [COMMENTSIZE],
139
		spacecraft    [COMMENTSIZE+1],
140
		target        [COMMENTSIZE],
140
		target        [COMMENTSIZE+1],
141
		filtname      [COMMENTSIZE],
141
		filtname      [COMMENTSIZE+1],
142
		gainmode      [COMMENTSIZE],
142
		gainmode      [COMMENTSIZE+1],
143
		editmode      [COMMENTSIZE],
143
		editmode      [COMMENTSIZE+1],
144
		scanmode      [COMMENTSIZE],
144
		scanmode      [COMMENTSIZE+1],
145
		exposure      [COMMENTSIZE],
145
		exposure      [COMMENTSIZE+1],
146
		shuttermode   [COMMENTSIZE],
146
		shuttermode   [COMMENTSIZE+1],
147
		mphase        [COMMENTSIZE],
147
		mphase        [COMMENTSIZE+1],
148
		iname         [COMMENTSIZE],
148
		iname         [COMMENTSIZE+1],
149
		itime         [COMMENTSIZE],
149
		itime         [COMMENTSIZE+1],
150
                garbage       [1020],
150
                garbage       [1024],
151
		*tmptmp,
151
		*tmptmp,
152
		pdsuncompfname[FNAMESIZE];
152
		pdsuncompfname[FNAMESIZE];
153
154
#define SSTR(l)			"%" #l "s"
155
#define S(l)			SSTR(l)
156
153
byte *image;
157
byte *image;
154
static int elaphe;
158
static int elaphe;
155
159
Lines 397-403 Link Here
397
401
398
      if (strcmp(scanbuff,"END") == 0) {
402
      if (strcmp(scanbuff,"END") == 0) {
399
	break;
403
	break;
400
      } else if (sscanf(scanbuff," RECORD_TYPE = %s",rtbuff) == 1) {
404
      } else if (sscanf(scanbuff, " RECORD_TYPE = " S(RTBUFFSIZE), rtbuff) == 1) {
401
	if (strncmp(rtbuff,"VARIABLE_LENGTH", (size_t) 15) == 0) {
405
	if (strncmp(rtbuff,"VARIABLE_LENGTH", (size_t) 15) == 0) {
402
	  /*		itype=PDSVARIABLE; */
406
	  /*		itype=PDSVARIABLE; */
403
	} else if (strncmp(rtbuff,"FIXED_LENGTH", (size_t) 12) == 0) {
407
	} else if (strncmp(rtbuff,"FIXED_LENGTH", (size_t) 12) == 0) {
Lines 416-422 Link Here
416
	    if (irecsize == 0) irecsize=recsize;
420
	    if (irecsize == 0) irecsize=recsize;
417
	lastwasinote=FALSE;
421
	lastwasinote=FALSE;
418
	continue;
422
	continue;
419
      } else if (sscanf(scanbuff," FILE_TYPE = %s", rtbuff) != 0) {
423
      } else if (sscanf(scanbuff, " FILE_TYPE = " S(RTBUFFSIZE), rtbuff) != 0) {
420
	lastwasinote=FALSE;
424
	lastwasinote=FALSE;
421
	if (strncmp(rtbuff,"IMAGE", (size_t) 5) == 0) {
425
	if (strncmp(rtbuff,"IMAGE", (size_t) 5) == 0) {
422
	  isimage=TRUE;
426
	  isimage=TRUE;
Lines 445-518 Link Here
445
	lastwasinote=FALSE; continue;
449
	lastwasinote=FALSE; continue;
446
      } else if (sscanf(scanbuff," SAMPLE_BITS = %d", &samplesize) == 1) {
450
      } else if (sscanf(scanbuff," SAMPLE_BITS = %d", &samplesize) == 1) {
447
	lastwasinote=FALSE; continue;
451
	lastwasinote=FALSE; continue;
448
      } else if (sscanf(scanbuff," SAMPLE_TYPE = %s", sampletype) == 1) {
452
      } else if (sscanf(scanbuff, " SAMPLE_TYPE = " S(64), sampletype) == 1) {
449
	lastwasinote=FALSE; continue;
453
	lastwasinote=FALSE; continue;
450
      } else if (sscanf(scanbuff," SPACECRAFT_NAME = %s %s",
454
      } else if (sscanf(scanbuff," SPACECRAFT_NAME = " S(COMMENTSIZE) " " S(1023),
451
			spacecraft,garbage) == 2 ) {
455
			spacecraft,garbage) == 2 ) {
452
	strcat(spacecraft,xv_strstr(scanbuff, spacecraft)+strlen(spacecraft));
456
	const char *tmp = xv_strstr(scanbuff, spacecraft) + strlen(spacecraft);
457
	strncat(spacecraft, tmp, COMMENTSIZE - strlen(spacecraft));
453
	lastwasinote=FALSE;  continue;
458
	lastwasinote=FALSE;  continue;
454
      } else if (sscanf(scanbuff," SPACECRAFT_NAME = %s", spacecraft) == 1) {
459
      } else if (sscanf(scanbuff, " SPACECRAFT_NAME = " S(COMMENTSIZE), spacecraft) == 1) {
455
	lastwasinote=FALSE; continue;
460
	lastwasinote=FALSE; continue;
456
461
457
      } else if (sscanf(scanbuff," TARGET_NAME = %s", target) == 1) {
462
      } else if (sscanf(scanbuff, " TARGET_NAME = " S(COMMENTSIZE), target) == 1) {
458
	lastwasinote=FALSE; continue;
463
	lastwasinote=FALSE; continue;
459
      } else if (sscanf(scanbuff," TARGET_BODY = %s", target) == 1) {
464
      } else if (sscanf(scanbuff, " TARGET_BODY = " S(COMMENTSIZE), target) == 1) {
460
	lastwasinote=FALSE; continue;
465
	lastwasinote=FALSE; continue;
461
466
462
      } else if (sscanf(scanbuff," MISSION_PHASE_NAME = %s", mphase) == 1) {
467
      } else if (sscanf(scanbuff, " MISSION_PHASE_NAME = " S(COMMENTSIZE), mphase) == 1) {
463
	lastwasinote=FALSE; continue;
468
	lastwasinote=FALSE; continue;
464
      } else if (sscanf(scanbuff," MISSION_PHASE = %s", mphase) == 1) {
469
      } else if (sscanf(scanbuff, " MISSION_PHASE = " S(COMMENTSIZE), mphase) == 1) {
465
	lastwasinote=FALSE; continue;
470
	lastwasinote=FALSE; continue;
466
471
467
      } else if (sscanf(scanbuff," INSTRUMENT_NAME = %s", iname) == 1) {
472
      } else if (sscanf(scanbuff, " INSTRUMENT_NAME = " S(COMMENTSIZE), iname) == 1) {
468
	lastwasinote=FALSE; continue;
473
	lastwasinote=FALSE; continue;
469
474
470
      } else if (sscanf(scanbuff," GAIN_MODE_ID = %s", gainmode) == 1) {
475
      } else if (sscanf(scanbuff, " GAIN_MODE_ID = " S(COMMENTSIZE), gainmode) == 1) {
471
	lastwasinote=FALSE; continue;
476
	lastwasinote=FALSE; continue;
472
477
473
      } else if (sscanf(scanbuff," INSTRUMENT_GAIN_STATE = %s",gainmode)==1) {
478
      } else if (sscanf(scanbuff, " INSTRUMENT_GAIN_STATE = " S(COMMENTSIZE), gainmode) ==1 ) {
474
	lastwasinote=FALSE; continue;
479
	lastwasinote=FALSE; continue;
475
480
476
      } else if (sscanf(scanbuff," EDIT_MODE_ID = %s", editmode) == 1) {
481
      } else if (sscanf(scanbuff, " EDIT_MODE_ID = " S(COMMENTSIZE), editmode) == 1) {
477
	lastwasinote=FALSE; continue;
482
	lastwasinote=FALSE; continue;
478
483
479
      } else if (sscanf(scanbuff," INSTRUMENT_EDIT_MODE = %s", editmode)==1) {
484
      } else if (sscanf(scanbuff, " INSTRUMENT_EDIT_MODE = " S(COMMENTSIZE), editmode) == 1) {
480
	lastwasinote=FALSE; continue;
485
	lastwasinote=FALSE; continue;
481
486
482
      } else if (sscanf(scanbuff," SCAN_MODE_ID = %s", scanmode) == 1) {
487
      } else if (sscanf(scanbuff, " SCAN_MODE_ID = " S(COMMENTSIZE), scanmode) == 1) {
483
	lastwasinote=FALSE; continue;
488
	lastwasinote=FALSE; continue;
484
489
485
      } else if (sscanf(scanbuff," INSTRUMENT_SCAN_RATE = %s", scanmode)==1) {
490
      } else if (sscanf(scanbuff, " INSTRUMENT_SCAN_RATE = " S(COMMENTSIZE), scanmode) == 1) {
486
	lastwasinote=FALSE; continue;
491
	lastwasinote=FALSE; continue;
487
492
488
      } else if (sscanf(scanbuff," SHUTTER_MODE_ID = %s", shuttermode) == 1) {
493
      } else if (sscanf(scanbuff, " SHUTTER_MODE_ID = " S(COMMENTSIZE), shuttermode) == 1) {
489
	lastwasinote=FALSE; continue;
494
	lastwasinote=FALSE; continue;
490
495
491
      } else if (sscanf(scanbuff," INSTRUMENT_SHUTTER_MODE = %s",
496
      } else if (sscanf(scanbuff, " INSTRUMENT_SHUTTER_MODE = " S(COMMENTSIZE), shuttermode) == 1) {
492
			shuttermode) == 1) {
493
	lastwasinote=FALSE; continue;
497
	lastwasinote=FALSE; continue;
494
498
495
      } else if (sscanf(scanbuff," SCAN_MODE_ID = %s", scanmode) == 1) {
499
      } else if (sscanf(scanbuff, " SCAN_MODE_ID = " S(COMMENTSIZE), scanmode) == 1) {
496
	lastwasinote=FALSE; continue;
500
	lastwasinote=FALSE; continue;
497
501
498
      } else if (sscanf(scanbuff," INSTRUMENT_SCAN_RATE = %s", scanmode)==1) {
502
      } else if (sscanf(scanbuff, " INSTRUMENT_SCAN_RATE = " S(COMMENTSIZE), scanmode) == 1) {
499
	lastwasinote=FALSE; continue;
503
	lastwasinote=FALSE; continue;
500
504
501
      } else if (sscanf(scanbuff," SPACECRAFT_EVENT_TIME = %s", itime) == 1) {
505
      } else if (sscanf(scanbuff, " SPACECRAFT_EVENT_TIME = " S(COMMENTSIZE), itime) == 1) {
502
	lastwasinote=FALSE; continue;
506
	lastwasinote=FALSE; continue;
503
507
504
      } else if (sscanf(scanbuff," IMAGE_TIME = %s", itime) == 1) {
508
      } else if (sscanf(scanbuff, " IMAGE_TIME = " S(COMMENTSIZE), itime) == 1) {
505
	lastwasinote=FALSE; continue;
509
	lastwasinote=FALSE; continue;
506
510
507
      } else if (sscanf(scanbuff," FILTER_NAME = %s", filtname) == 1) {
511
      } else if (sscanf(scanbuff, " FILTER_NAME = " S(COMMENTSIZE), filtname) == 1) {
508
	lastwasinote=FALSE; continue;
512
	lastwasinote=FALSE; continue;
509
513
510
      } else if (sscanf(scanbuff," INSTRUMENT_FILTER_NAME = %s",filtname)==1) {
514
      } else if (sscanf(scanbuff, " INSTRUMENT_FILTER_NAME = " S(COMMENTSIZE), filtname) == 1) {
511
	lastwasinote=FALSE; continue;
515
	lastwasinote=FALSE; continue;
512
516
513
      } else if ((sscanf(scanbuff," EXPOSURE_DURATION = %s", exposure) == 1)
517
      } else if ((sscanf(scanbuff, " EXPOSURE_DURATION = " S(COMMENTSIZE), exposure) == 1)
514
	      || (sscanf(scanbuff," INSTRUMENT_EXPOSURE_DURATION = %s",
518
	      || (sscanf(scanbuff, " INSTRUMENT_EXPOSURE_DURATION = " S(COMMENTSIZE),
515
			 exposure) == 1)) {
519
			 exposure)) == 1) {
516
	tmptmp = (char *) index(scanbuff,'=');
520
	tmptmp = (char *) index(scanbuff,'=');
517
	tmptmp++;
521
	tmptmp++;
518
	while((*tmptmp) == ' ')
522
	while((*tmptmp) == ' ')
Lines 520-529 Link Here
520
	strcpy(exposure,tmptmp);
524
	strcpy(exposure,tmptmp);
521
	lastwasinote=FALSE; continue;
525
	lastwasinote=FALSE; continue;
522
526
523
      } else if (sscanf(scanbuff, "NOTE = %s", inote) == 1) {
527
      } else if (sscanf(scanbuff, "NOTE = " S(INOTESIZE), inote) == 1) {
524
	tmptmp = (char *) index(scanbuff,'='); tmptmp++;
528
	tmptmp = (char *) index(scanbuff,'='); tmptmp++;
525
	while (((*tmptmp) == ' ') || ((*tmptmp)  == '"')) tmptmp++;
529
	while (((*tmptmp) == ' ') || ((*tmptmp)  == '"')) tmptmp++;
526
	strcpy(inote,tmptmp);
530
	strncpy(inote, tmptmp, INOTESIZE - 1);
527
	strcat(inote," ");
531
	strcat(inote," ");
528
532
529
	/*   evil and somewhat risky:  A "note" (really, any textual
533
	/*   evil and somewhat risky:  A "note" (really, any textual
Lines 548-554 Link Here
548
      } else if (lastwasinote) {
552
      } else if (lastwasinote) {
549
	tmptmp=scanbuff;
553
	tmptmp=scanbuff;
550
	while (((*tmptmp) == ' ') || ((*tmptmp)  == '"')) tmptmp++;
554
	while (((*tmptmp) == ' ') || ((*tmptmp)  == '"')) tmptmp++;
551
	strcat(inote,tmptmp);
555
	strncat(inote, tmptmp, INOTESIZE - strlen(inote) - 1);
552
	strcat(inote," ");
556
	strcat(inote," ");
553
	if (index(tmptmp,'"') != NULL)
557
	if (index(tmptmp,'"') != NULL)
554
	    lastwasinote=FALSE;
558
	    lastwasinote=FALSE;
Lines 647-673 Link Here
647
651
648
  *infobuff='\0';
652
  *infobuff='\0';
649
  if (*spacecraft) {
653
  if (*spacecraft) {
650
    strcat(infobuff,spacecraft);
654
    strncat(infobuff, spacecraft, sizeof(infobuff) - 1);
651
  }
655
  }
652
656
653
  if (*target) {
657
  if (*target) {
654
    strcat(infobuff,", ");
658
    strncat(infobuff, ", ", sizeof(infobuff) - strlen(infobuff) - 1);
655
    strcat(infobuff,target);
659
    strncat(infobuff, target, sizeof(infobuff) - strlen(infobuff) - 1);
656
  }
660
  }
657
661
658
  if (*filtname) {
662
  if (*filtname) {
659
    strcat(infobuff,", ");
663
    strncat(infobuff, ", ", sizeof(infobuff) - strlen(infobuff) - 1);
660
    strcat(infobuff,filtname);
664
    strncat(infobuff, filtname, sizeof(infobuff) - strlen(infobuff) - 1);
661
  }
665
  }
662
666
663
  if (*itime) {
667
  if (*itime) {
664
    strcat(infobuff,", ");
668
    strncat(infobuff, ", ", sizeof(infobuff) - strlen(infobuff) - 1);
665
    strcat(infobuff,itime);
669
    strncat(infobuff, itime, sizeof(infobuff) - strlen(infobuff) - 1);
666
  }
670
  }
667
671
668
  SetISTR(ISTR_WARNING,infobuff);
672
  SetISTR(ISTR_WARNING, "%s", infobuff);
669
673
670
  strcpy(pdsuncompfname,fname);
674
  strncpy(pdsuncompfname,fname,sizeof(pdsuncompfname) - 1);
671
  ftypstr = "";
675
  ftypstr = "";
672
676
673
  switch (itype) {
677
  switch (itype) {
Lines 695-701 Link Here
695
    fclose(zf);
699
    fclose(zf);
696
700
697
#ifndef VMS
701
#ifndef VMS
698
    sprintf(pdsuncompfname,"%s/xvhuffXXXXXX", tmpdir);
702
    snprintf(pdsuncompfname, sizeof(pdsuncompfname) - 1, "%s/xvhuffXXXXXX", tmpdir);
699
#else
703
#else
700
    strcpy(pdsuncompfname,"sys$disk:[]xvhuffXXXXXX");
704
    strcpy(pdsuncompfname,"sys$disk:[]xvhuffXXXXXX");
701
#endif
705
#endif
Lines 707-713 Link Here
707
#endif
711
#endif
708
712
709
#ifndef VMS
713
#ifndef VMS
710
    sprintf(scanbuff,"%s %s - 4 >%s",PDSUNCOMP,fname,pdsuncompfname);
714
    sprintf(scanbuff,"%s '%s' - 4 > %s", PDSUNCOMP, fname, pdsuncompfname);
711
#else
715
#else
712
    sprintf(scanbuff,"%s %s %s 4",PDSUNCOMP,fname,pdsuncompfname);
716
    sprintf(scanbuff,"%s %s %s 4",PDSUNCOMP,fname,pdsuncompfname);
713
#endif
717
#endif
Lines 824-848 Link Here
824
    *(pinfo->comment) = '\0';
828
    *(pinfo->comment) = '\0';
825
829
826
    sprintf(tmp, "Spacecraft: %-28sTarget: %-32s\n", spacecraft, target);
830
    sprintf(tmp, "Spacecraft: %-28sTarget: %-32s\n", spacecraft, target);
827
    strcat(pinfo->comment, tmp);
831
    strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1);
828
832
829
    sprintf(tmp, "Filter: %-32sMission phase: %-24s\n", filtname, mphase);
833
    sprintf(tmp, "Filter: %-32sMission phase: %-24s\n", filtname, mphase);
830
    strcat(pinfo->comment, tmp);
834
    strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1);
831
835
832
    sprintf(tmp, "Image time: %-28sGain mode: %-29s\n", itime, gainmode);
836
    sprintf(tmp, "Image time: %-28sGain mode: %-29s\n", itime, gainmode);
833
    strcat(pinfo->comment, tmp);
837
    strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1);
834
838
835
    sprintf(tmp, "Edit mode: %-29sScan mode: %-29s\n", editmode, scanmode);
839
    sprintf(tmp, "Edit mode: %-29sScan mode: %-29s\n", editmode, scanmode);
836
    strcat(pinfo->comment, tmp);
840
    strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1);
837
841
838
    sprintf(tmp, "Exposure: %-30sShutter mode: %-25s\n", exposure,shuttermode);
842
    sprintf(tmp, "Exposure: %-30sShutter mode: %-25s\n", exposure,shuttermode);
839
    strcat(pinfo->comment, tmp);
843
    strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1);
840
844
841
    sprintf(tmp, "Instrument: %-28sImage time: %-28s\n", iname, itime);
845
    sprintf(tmp, "Instrument: %-28sImage time: %-28s\n", iname, itime);
842
    strcat(pinfo->comment, tmp);
846
    strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1);
843
847
844
    sprintf(tmp, "Image Note: %-28s", inote);
848
    sprintf(tmp, "Image Note: %-28.28s", inote);
845
    strcat(pinfo->comment, tmp);
849
    strncat(pinfo->comment, tmp, 2000 - strlen(pinfo->comment) - 1);
846
  }
850
  }
847
851
848
  if (LoadPDSPalette(fname, pinfo))  return 1;
852
  if (LoadPDSPalette(fname, pinfo))  return 1;
(-)xv-3.10a.orig/xvps.c (-7 / +24 lines)
Lines 1561-1567 Link Here
1561
     the first one is loaded (but not deleted) */
1561
     the first one is loaded (but not deleted) */
1562
1562
1563
#ifdef GS_PATH
1563
#ifdef GS_PATH
1564
  char tmp[512], gscmd[512], cmdstr[512], tmpname[64];
1564
  #define CMDSIZE	1024
1565
  char tmp[512], gscmd[512], cmdstr[CMDSIZE], tmpname[64];
1565
  int  gsresult, nump, i, filetype, doalert, epsf;
1566
  int  gsresult, nump, i, filetype, doalert, epsf;
1566
#endif
1567
#endif
1567
1568
Lines 1733-1764 Link Here
1733
1734
1734
/******************************************************************/
1735
/******************************************************************/
1735
#ifdef GS_PATH
1736
#ifdef GS_PATH
1736
void buildCmdStr(str, gscmd, fname, quick, epsf)
1737
void buildCmdStr(str, gscmd, xname, quick, epsf)
1737
     char *str, *gscmd, *fname;
1738
     char *str, *gscmd, *xname;
1738
     int   quick, epsf;
1739
     int   quick, epsf;
1739
{
1740
{
1740
  /* note 'epsf' set only on files that don't have a showpage cmd */
1741
  /* note 'epsf' set only on files that don't have a showpage cmd */
1742
  char *x, *y, *fname;
1743
1744
  x = (char *) malloc((5 * strlen(xname))+3);
1745
  if (!x)
1746
	FatalError("malloc failure in xvps.c buildCmdStr");
1747
  fname = x;
1748
  *x++ = 0x27;
1749
1750
  for (y = xname; *y; ++y) {
1751
     if (0x27 == *y) {
1752
       strcpy(x, "'\"'\"'");
1753
       x += strlen(x);
1754
     } else *x++ = *y;
1755
  }
1756
  strcpy (x, "'");
1741
1757
1742
#ifndef VMS
1758
#ifndef VMS
1743
1759
1744
  if      (epsf)  sprintf(str, "echo '\n showpage ' | cat '%s' - | %s -",
1760
  if      (epsf)  snprintf(str, CMDSIZE, "echo '\n showpage ' | cat %s - | %s -",
1745
			  fname, gscmd);
1761
			  fname, gscmd);
1746
1762
1747
  else if (quick) sprintf(str, "echo '%s' | cat - '%s' | %s -",
1763
  else if (quick) snprintf(str, CMDSIZE, "echo %s | cat - %s | %s -",
1748
			  "/showpage { showpage quit } bind def",
1764
			  "/showpage { showpage quit } bind def",
1749
			  fname,  gscmd);
1765
			  fname,  gscmd);
1750
1766
1751
  else            sprintf(str, "%s -- %s", gscmd, fname);
1767
  else            snprintf(str, CMDSIZE, "%s -- %s", gscmd, fname);
1752
1768
1753
#else /* VMS */
1769
#else /* VMS */
1754
  /* VMS doesn't have pipes or an 'echo' command and GS doesn't like
1770
  /* VMS doesn't have pipes or an 'echo' command and GS doesn't like
1755
     Unix-style file names as input files in the VMS version */
1771
     Unix-style file fnames as input files in the VMS version */
1756
  strcat(tmp, " -- ");
1772
  strcat(tmp, " -- ");
1757
  rld = strrchr(fname, '/');     /* Pointer to last '/' */
1773
  rld = strrchr(fname, '/');     /* Pointer to last '/' */
1758
  if (rld) rld++;                /* Pointer to filename */
1774
  if (rld) rld++;                /* Pointer to filename */
1759
  else rld = fname;              /* No path - use original string */
1775
  else rld = fname;              /* No path - use original string */
1760
  strcat(tmp, rld);
1776
  strcat(tmp, rld);
1761
#endif  /* VMS */
1777
#endif  /* VMS */
1778
  free(fname);
1762
}
1779
}
1763
#endif  /* GS_PATH */
1780
#endif  /* GS_PATH */
1764
1781
(-)xv-3.10a.orig/xvtiff.c (-2 / +2 lines)
Lines 512-518 Link Here
512
  vsprintf(cp, fmt, ap);
512
  vsprintf(cp, fmt, ap);
513
  strcat(cp, ".");
513
  strcat(cp, ".");
514
514
515
  SetISTR(ISTR_WARNING,buf);
515
  SetISTR(ISTR_WARNING, "%s", buf);
516
516
517
  error_occurred = 1;
517
  error_occurred = 1;
518
}
518
}
Lines 536-542 Link Here
536
  vsprintf(cp, fmt, ap);
536
  vsprintf(cp, fmt, ap);
537
  strcat(cp, ".");
537
  strcat(cp, ".");
538
538
539
  SetISTR(ISTR_WARNING,buf);
539
  SetISTR(ISTR_WARNING, "%s", buf);
540
}
540
}
541
541
542
542

Return to bug 88742