lynx2-8-7-tmp_dir.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --- lynx2-8-7/src/LYMain.c.orig 2009-07-06 01:52:33.000000000 +0200
  2. +++ lynx2-8-7/src/LYMain.c 2010-01-03 14:58:31.000000000 +0100
  3. @@ -967,6 +967,7 @@
  4. struct stat dir_info;
  5. char filename[LY_MAXPATH];
  6. BOOL LYGetStdinArgs = FALSE;
  7. + struct stat st;
  8. #ifdef _WINDOWS
  9. WSADATA WSAData;
  10. @@ -1209,6 +1210,21 @@
  11. #endif
  12. LYTildeExpand(&lynx_temp_space, TRUE);
  13. +
  14. + if (stat(lynx_temp_space, &st) < 0) {
  15. + if (errno = ENOENT) {
  16. + printf("Creating dir %s\n", lynx_temp_space);
  17. + mkdir(lynx_temp_space, 0700);
  18. + }
  19. + }
  20. +
  21. + if (stat(lynx_temp_space, &st) < 0) {
  22. + if (errno = ENOENT) {
  23. + printf("Can't create %s, let's try /tmp/\n", lynx_temp_space);
  24. + lynx_temp_space = "/tmp/";
  25. + }
  26. + }
  27. +
  28. if ((cp = strstr(lynx_temp_space, "$USER")) != NULL) {
  29. char *cp1;
  30. --- lynx2-8-7/userdefs.h.orig 2010-01-03 14:58:31.000000000 +0100
  31. +++ lynx2-8-7/userdefs.h 2010-01-03 14:58:31.000000000 +0100
  32. @@ -354,7 +354,7 @@
  33. * the "TMPDIR" (unix), or "TEMP" or "TMP" (Windows,DOS,OS/2)
  34. * variable.
  35. */
  36. -#define TEMP_SPACE "/tmp/"
  37. +#define TEMP_SPACE "~/tmp/"
  38. /********************************
  39. * Comment this line out to disable code that implements command logging