diff -ruN xv-3.10a.orig/xvbrowse.c xv-3.10a/xvbrowse.c --- xv-3.10a.orig/xvbrowse.c 2005-04-11 17:55:47.000000000 +0100 +++ xv-3.10a/xvbrowse.c 2005-04-11 22:37:27.000000000 +0100 @@ -4950,7 +4950,18 @@ if (dstdir) { #ifndef VMS /* we don't delete directories in VMS */ - sprintf(buf, "rm -rf %s", dst); + char *x, *y, *name; + + x = name = (char *) malloc((5 * strlen(dst))+3);*x++ = 0x27; + for (y = dst; *y; ++y) { + if (0x27 == *y) { + strcpy(x, "'\"'\"'"); + x += strlen(x); + } else *x++ = *y; + } + strcpy (x, "'"); + sprintf(buf, "rm -rf %s", name); + free (name); if (system(buf)) { /* okay, so it's cheating... */ SetISTR(ISTR_WARNING, "Unable to remove directory %s", dst); return 1; diff -ruN xv-3.10a.orig/xv.c xv-3.10a/xv.c --- xv-3.10a.orig/xv.c 2005-04-11 17:55:47.000000000 +0100 +++ xv-3.10a/xv.c 2005-04-11 22:51:11.000000000 +0100 @@ -2828,7 +2828,7 @@ /* returns '1' on success, with name of uncompressed file in uncompname returns '0' on failure */ - char namez[128], *fname, buf[512]; + char namez[128], *fname, buf[512], *tname; fname = name; namez[0] = '\0'; @@ -2871,11 +2871,27 @@ #endif #ifndef VMS - if (filetype == RFT_COMPRESS) - sprintf(buf,"%s -c %s >%s", UNCOMPRESS, fname, uncompname); + if (filetype == RFT_COMPRESS || filetype == RFT_BZIP2) { + char *x, *y; + + x = tname = (char *) malloc((5 * strlen(fname))+3);*x++ = 0x27; + for (y = fname; *y; ++y) { + if (0x27 == *y) { + strcpy(x, "'\"'\"'"); + x += strlen(x); + } else *x++ = *y; + } + strcpy (x, "'"); + } + if (filetype == RFT_COMPRESS) { + sprintf(buf,"%s -c %s >%s", UNCOMPRESS, tname, uncompname); + free (tname); + } # ifdef BUNZIP2 - else if (filetype == RFT_BZIP2) - sprintf(buf,"%s -c %s >%s", BUNZIP2, fname, uncompname); + else if (filetype == RFT_BZIP2) { + sprintf(buf,"%s -c %s >%s", BUNZIP2, tname, uncompname); + free (tname); + } # endif #else /* it IS VMS */ # ifdef GUNZIP Files xv-3.10a.orig/xv.core and xv-3.10a/xv.core differ Files xv-3.10a.orig/.xvgam.c.swp and xv-3.10a/.xvgam.c.swp differ diff -ruN xv-3.10a.orig/xvpds.c xv-3.10a/xvpds.c --- xv-3.10a.orig/xvpds.c 2005-04-11 17:55:45.000000000 +0100 +++ xv-3.10a/xvpds.c 2005-04-11 20:53:31.000000000 +0100 @@ -191,7 +191,7 @@ count=0; bp=buff; - while (1) { + while (countcomment) = '\0'; - sprintf(tmp, "Spacecraft: %-28sTarget: %-32s\n", spacecraft, target); + snprintf(tmp, sizeof (tmp), "Spacecraft: %-28sTarget: %-32s\n", spacecraft, target); strcat(pinfo->comment, tmp); - sprintf(tmp, "Filter: %-32sMission phase: %-24s\n", filtname, mphase); + snprintf(tmp, sizeof (tmp), "Filter: %-32sMission phase: %-24s\n", filtname, mphase); strcat(pinfo->comment, tmp); - sprintf(tmp, "Image time: %-28sGain mode: %-29s\n", itime, gainmode); + snprintf(tmp, sizeof (tmp), "Image time: %-28sGain mode: %-29s\n", itime, gainmode); strcat(pinfo->comment, tmp); - sprintf(tmp, "Edit mode: %-29sScan mode: %-29s\n", editmode, scanmode); + snprintf(tmp, sizeof (tmp), "Edit mode: %-29sScan mode: %-29s\n", editmode, scanmode); strcat(pinfo->comment, tmp); - sprintf(tmp, "Exposure: %-30sShutter mode: %-25s\n", exposure,shuttermode); + snprintf(tmp, sizeof (tmp), "Exposure: %-30sShutter mode: %-25s\n", exposure,shuttermode); strcat(pinfo->comment, tmp); - sprintf(tmp, "Instrument: %-28sImage time: %-28s\n", iname, itime); + snprintf(tmp, sizeof (tmp), "Instrument: %-28sImage time: %-28s\n", iname, itime); strcat(pinfo->comment, tmp); - sprintf(tmp, "Image Note: %-28s", inote); + snprintf(tmp, sizeof (tmp), "Image Note: %-28s", inote); strcat(pinfo->comment, tmp); } diff -ruN xv-3.10a.orig/xvps.c xv-3.10a/xvps.c --- xv-3.10a.orig/xvps.c 2005-04-11 17:55:47.000000000 +0100 +++ xv-3.10a/xvps.c 2005-04-11 21:51:27.000000000 +0100 @@ -1629,14 +1629,26 @@ do { - buildCmdStr(cmdstr, gscmd, fname, quick, epsf); + char *x, *y, *name; + x = name = (char *) malloc((5 * strlen(fname))+3);*x++ = 0x27; + for (y = fname; *y; ++y) { + if (0x27 == *y) { + strcpy(x, "'\"'\"'"); + x += strlen(x); + } else *x++ = *y; + } + strcpy (x, "'"); + + buildCmdStr(cmdstr, gscmd, name, quick, epsf); + free (name); if (DEBUG) fprintf(stderr,"LoadPS: executing command '%s'\n", cmdstr); SetISTR(ISTR_INFO, "Running '%s'...", GS_PATH); sprintf(tmp, "Running %s", cmdstr); if (doalert && epsf==0) OpenAlert(tmp); /* open alert first time only */ WaitCursor(); + gsresult = system(cmdstr); WaitCursor(); #ifdef VMS @@ -1741,10 +1753,10 @@ #ifndef VMS - if (epsf) sprintf(str, "echo '\n showpage ' | cat '%s' - | %s -", + if (epsf) sprintf(str, "echo '\n showpage ' | cat %s - | %s -", fname, gscmd); - else if (quick) sprintf(str, "echo '%s' | cat - '%s' | %s -", + else if (quick) sprintf(str, "echo '%s' | cat - %s | %s -", "/showpage { showpage quit } bind def", fname, gscmd); diff -ruN xv-3.10a.orig/xvtiff.c xv-3.10a/xvtiff.c --- xv-3.10a.orig/xvtiff.c 2005-04-11 17:55:47.000000000 +0100 +++ xv-3.10a/xvtiff.c 2005-04-11 17:59:13.000000000 +0100 @@ -512,7 +512,7 @@ vsprintf(cp, fmt, ap); strcat(cp, "."); - SetISTR(ISTR_WARNING,buf); + SetISTR(ISTR_WARNING,"%s",buf); error_occurred = 1; } @@ -536,7 +536,7 @@ vsprintf(cp, fmt, ap); strcat(cp, "."); - SetISTR(ISTR_WARNING,buf); + SetISTR(ISTR_WARNING,"%s",buf); }