freebsd-ports/graphics/xfpovray/files/patch-src_show_image.c
Mikhail Teterin 337793a270 The actual reason, this port was broken was a bug in a recent version of
x11-toolkits/xforms. That bug was fixed earlier today.

Make sure, this builds with both erroneous as well as corrected xforms.

Fix the problems with parallelized build -- by replacing the upstream's
rudimentary Imakefiles with a BSDmakefile. Relocate application's help-
files into DOCSDIR.

Fix compiler warnings up to WARNS=3 and a few genuine (if ancient) bugs,
that this process revealed. Bump PORTREVISION and unbreak.
2015-03-09 06:21:47 +00:00

52 lines
1.3 KiB
C

--- src/show_image.c 1998-02-07 22:09:16.000000000 -0500
+++ src/show_image.c 2015-03-09 00:55:58.000000000 -0400
@@ -2,7 +2,8 @@
#include <stddef.h>
#include <string.h>
-#include "forms.h"
+#include <forms.h>
+#include "flx.h"
#include "xfpovray.h"
extern struct pov_options pov;
@@ -13,21 +14,6 @@
extern OUTPUT_PAGE_S *outputPage;
-
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-char *truncate(char *string, char endat)
-{
- char *endchar;
-
-
- if ((string != NULL) && (endchar = strrchr(string, endat)) != NULL)
- *endchar = '\0';
-
- return (string);
-
-}
-
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
** Display the image after rendering. Some OS do not allow
@@ -45,7 +31,7 @@
strcpy(temp, pov.input_file_name);
- sprintf(imgfile, "%s", truncate(temp, '.'));
+ sprintf(imgfile, "%s", strtruncate(temp, '.'));
/*
@@ -63,7 +49,7 @@
strcat(imgfile, ext);
sprintf(currentFilter, "*%s", ext);
- file = (char *) flx_filebox (CONFIG_POV_DIR, currentFilter, &imgfile);
+ file = flx_filebox (CONFIG_POV_DIR, currentFilter, imgfile);
if (strcmp(file, "") != 0) {
sprintf(viewit, "%s %s &", CONFIG_DISPLAY_COMMAND, imgfile);