summaryrefslogtreecommitdiff
path: root/x11/xview-lib/patches/patch-dg
blob: 93412d88fe7cbec449d6bd81d596c17326d129ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
$NetBSD: patch-dg,v 1.2 2009/12/10 20:35:58 abs Exp $

--- lib/libxview/textsw/txt_incl.c.orig	1993-06-29 05:17:32.000000000 +0000
+++ lib/libxview/textsw/txt_incl.c
@@ -35,6 +35,12 @@ static char     sccsid[] = "@(#)txt_incl
 #include <string.h>
 #endif /* SVR4 */
 
+#include <sys/param.h>
+
+#if (defined(SVR4) || (__NetBSD_Version__ >= 103080000))
+#define GETCWD
+#endif
+
 #define		MAX_DISPLAY_LENGTH	50
 #define   	MAX_STR_LENGTH		1024
 
@@ -108,18 +114,18 @@ do_include_proc(folio, ie)
 
     /* if "cd" is not disabled and the "cd" dir is not the current dir */
 #ifdef OW_I18N
-#ifdef SVR4
+#ifdef GETCWD
     (void) getcwd(curr_dir_mb, MAX_STR_LENGTH);
 #else
     (void) getwd(curr_dir_mb);
-#endif /* SVR4 */
+#endif /* GETCWD */
     (void) mbstowcs(curr_dir, curr_dir_mb, MAX_STR_LENGTH);
 #else /* OW_I18N */
-#ifdef SVR4
+#ifdef GETCWD
     (void) getcwd(curr_dir, MAX_STR_LENGTH);
 #else
     (void) getwd(curr_dir);
-#endif /* SVR4 */
+#endif /* GETCWD */
 #endif /* OW_I18N */
 
     textsw_changed_directory = FALSE;
@@ -272,11 +278,11 @@ create_include_items(panel, view)
     include_string[0] = NULL;
     (void) textsw_get_selection(view, &dummy, &dummy, include_string,
 				MAX_STR_LENGTH);
-#ifdef SVR4
+#ifdef GETCWD
  (void) getcwd(current_dir_include_string, MAX_STR_LENGTH);
 #else
   (void) getwd(current_dir_include_string);
-#endif /* SVR4 */
+#endif /* GETCWD */
     include_panel_items[(int) DIR_STRING_ITEM] =
 	panel_create_item(panel, PANEL_TEXT,
 			  PANEL_LABEL_X, ATTR_COL(0),
@@ -384,18 +390,18 @@ include_cmd_proc(fc,path,file,client_dat
 
     /* if "cd" is not disabled and the "cd" dir is not the current dir */
 #ifdef OW_I18N
-#ifdef SVR4
+#ifdef GETCWD
     (void) getcwd(curr_dir_mb, MAX_STR_LENGTH);
 #else
     (void) getwd(curr_dir_mb);
-#endif /* SVR4 */
+#endif /* GETCWD */
     (void) mbstowcs(curr_dir, curr_dir_mb, MAX_STR_LENGTH);
 #else /* OW_I18N */
-#ifdef SVR4
+#ifdef GETCWD
     (void) getcwd(curr_dir, MAX_STR_LENGTH);
 #else
     (void) getwd(curr_dir);
-#endif /* SVR4 */
+#endif /* GETCWD */
 #endif /* OW_I18N */
 
     textsw_changed_directory = FALSE;