On 2/8/07, Ben Pfaff <[EMAIL PROTECTED]> wrote:
I'd rather seek other solutions (for example, improving gnulib or
fixing mingw) before modifying correct PSPP code, not least
because I'm liable to forget why code has been changed away from
what seems obviously correct.
mkstemp is also missing. This can be fixed simply by replacing with
mkstemps. OTOH, perhaps gnulib should handle this as well?
In the same file as mkstemp, we should test for TMP/TEMP as well or
instead of TMPDIR. I've attached a patch.
On the topic of missing functions, nl_langinfo also seems to be
missing. I've replaced it with the following stub:
char *nl_langinfo(nl_item item)
{
puts("**** STUB nl_langinfo *****");
return "Sun\0";
}
--
John C. McCabe-Dansted
PhD Student
University of Western Australia
Index: ./src/data/make-file.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/make-file.c,v
retrieving revision 1.7
diff -r1.7 make-file.c
37a38,61
> char* get_temp_dir ()
> {
> const char *parent_dir;
>
> if (getenv ("TMPDIR") != NULL)
> {
> parent_dir = getenv ("TMPDIR");
> }
> else if (getenv ("TEMP") != NULL)
> {
> parent_dir = getenv ("TEMP");
> }
> else if (getenv ("TMP") != NULL)
> {
> parent_dir = getenv ("TMP");
> }
> else
> {
> parent_dir = P_tmpdir;
> }
>
> return parent_dir;
> }
>
44c68
< const char *parent_dir;
---
> const char *parent_dir=get_temp_dir();
49,53d72
< if (getenv ("TMPDIR") != NULL)
< parent_dir = getenv ("TMPDIR");
< else
< parent_dir = P_tmpdir;
<
55a75
> #ifdef __MINGW__
56a77,79
> #else
> *fd = mkstemps (*file_name,0);
> #endif
76c99
< const char *parent_dir;
---
> const char *parent_dir=get_temp_dir();
87,91d109
< if (getenv ("TMPDIR") != NULL)
< parent_dir = getenv ("TMPDIR");
< else
< parent_dir = P_tmpdir;
<
_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev