/[gcl]/gcl/o/pathname.d
ViewVC logotype

Diff of /gcl/o/pathname.d

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by mjthomas, Mon Feb 24 07:28:48 2003 UTC revision 1.12 by mjthomas, Tue Feb 25 04:41:50 2003 UTC
# Line 69  int end; Line 69  int end;
69     TLC from someone who feels pedantic. MJT */     TLC from someone who feels pedantic. MJT */
70    
71  /* !!!!! Bug Fix. NLG */  /* !!!!! Bug Fix. NLG */
72  static object  object
73  parse_namestring(s, start, end, ep)  parse_namestring(s, start, end, ep)
74  object s;  object s;
75  int start, end, *ep;  int start, end, *ep;
76  {  {
77          int i, j, k, founddosdev = FALSE, oldstart=start, oldend=end;          int i, j, k, founddosdev = FALSE, oldstart=start, oldend=end, justdevice = FALSE;
78          int d;          int d;
79          object *vsp;          object *vsp;
80          object x;          object x;
# Line 84  int start, end, *ep; Line 84  int start, end, *ep;
84  #define IS_DIR_SEPARATOR(x) (x == '/')  #define IS_DIR_SEPARATOR(x) (x == '/')
85  #endif  #endif
86    
87            *ep=oldend;
88          vsp = vs_top + 1;          vsp = vs_top + 1;
89          for (;--end >= start && isspace((int)s->st.st_self[end]););          for (;--end >= start && isspace((int)s->st.st_self[end]););
90    
# Line 91  int start, end, *ep; Line 92  int start, end, *ep;
92          if ( ( (start+1) <= end) &&  (s->st.st_self[start+1] == ':' )) {          if ( ( (start+1) <= end) &&  (s->st.st_self[start+1] == ':' )) {
93              start+=2;              start+=2;
94              founddosdev = TRUE;              founddosdev = TRUE;
             *ep=oldend;  
95          }          }
96          if ( start > end ) {          if ( start > end ) {
             vs_push(Cnil);  
             while (vs_top > vsp)  
                 stack_cons();  
             vs_push(Cnil);  
97              make_one(&s->st.st_self[0], 0);              make_one(&s->st.st_self[0], 0);
98              *ep=oldend;              justdevice = TRUE;
99          } else {          } else {
100              for (i = j = start;  i <= end;  ) {              for (i = j = start;  i <= end;  ) {
101  #ifdef UNIX  #ifdef UNIX
102                  if (IS_DIR_SEPARATOR(s->st.st_self[i])) {                  if (IS_DIR_SEPARATOR(s->st.st_self[i])) {
103  #endif  #endif
104                          if (j == 0 && i == 0) {                          if (j == start && i == start) {
105                                  i++;                                  i++;
106                                  vs_push(sKroot);                                  vs_push(sKroot);
107                                  j = i;                                  j = i;
108                                  continue;                                  continue;
109                          }                          }
110  #ifdef UNIX  #ifdef UNIX
                         /* BUG FIX by Grant J. Munsey */  
                         if ( 0 && i == j) {  
                                 i++;  
                                 j = i;  
                                 continue;  
                         }  
                         /* END OF BUG FIX */  
111                          if (i-j == 1 && s->st.st_self[j] == '.') {                          if (i-j == 1 && s->st.st_self[j] == '.') {
112                                  vs_push(sKcurrent);                                  vs_push(sKcurrent);
113                          } else if (i-j==2 && s->st.st_self[j]=='.' && s->st.st_self[j+1]=='.') {                          } else if (i-j==2 && s->st.st_self[j]=='.' && s->st.st_self[j+1]=='.') {
# Line 197  L: Line 186  L:
186              /* No device name */              /* No device name */
187              vs_push(Cnil);              vs_push(Cnil);
188          }          }
189          x = make_pathname ( Cnil, vs_top[-1], vs_top[-4], vs_top[-3], vs_top[-2], Cnil );          if ( justdevice ) {
190                x = make_pathname ( Cnil, vs_top[-1], Cnil, Cnil, Cnil, Cnil );
191            } else {
192                x = make_pathname ( Cnil, vs_top[-1], vs_top[-4], vs_top[-3], vs_top[-2], Cnil );
193            }
194          vs_reset;          vs_reset;
195          return(x);          return(x);
196  }  }
# Line 416  N: Line 409  N:
409           FIX_FILENAME(x,buf);           FIX_FILENAME(x,buf);
410           return (make_simple_string(buf));           return (make_simple_string(buf));
411           }           }
412  #endif          #endif
413          return(copy_simple_string(token));          return(copy_simple_string(token));
414  }  }
415    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26