summaryrefslogtreecommitdiff
path: root/devel/tvision/files/patch-tfiledialog
blob: 524045db430b2efd1a025675ca8dc7331aafbf18 (plain) (blame)
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
Un*x filenames can easily contain spaces ... Don't trim the filename.

diff -ur tvision-0.8-orig/lib/TFileDialog.cc lib/TFileDialog.cc
--- tvision-0.8-orig/lib/TFileDialog.cc	Thu Jul 26 09:59:20 2001
+++ lib/TFileDialog.cc	Wed Sep  8 14:14:15 2004
@@ -162,6 +162,7 @@
 
 /* 'src' is cast to unsigned char * so that isspace sign extends it
    correctly. */
+/* Function defined but not used
 static void trim( char *dest, const char *src )
 {
     while( *src != EOS && isspace( * (const unsigned char *) src ) )
@@ -170,11 +171,13 @@
         *dest++ = *src++;
     *dest = EOS;
 }
+*/
 
 void TFileDialog::getFileName( char *s )
 {
     /* SS: changed */
 
+#if 0
     char buf[PATH_MAX];
 
     trim( buf, fileName->data );
@@ -185,6 +188,15 @@
         }
     fexpand( buf );
     strcpy( s, buf );
+#else
+    strcpy( s, fileName->data );
+    if( relativePath( s ) == True )
+        {
+        strcpy( s, directory );
+        strcat( s, fileName->data );
+        }
+    fexpand( s );
+#endif
 }
 
 void TFileDialog::handleEvent(TEvent& event)