/[mc]/mc/vfs/utilvfs.c
ViewVC logotype

Diff of /mc/vfs/utilvfs.c

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

revision 1.2 by unammx, Sat Mar 7 20:27:55 1998 UTC revision 1.3 by pavel, Sun Sep 13 10:40:54 1998 UTC
# Line 178  char *get_host_and_username (char *path, Line 178  char *get_host_and_username (char *path,
178      /* Check if the host comes with a port spec, if so, chop it */      /* Check if the host comes with a port spec, if so, chop it */
179      colon = strchr (rest, ':');      colon = strchr (rest, ':');
180      if (colon){      if (colon){
         *port = atoi (colon+1);  
   
         if (*port <= 0 || *port >= 65536)  
             *port = 21;  
181          *colon = 0;          *colon = 0;
182            if (sscanf(colon+1, "%d", port)==1) {
183                if (*port <= 0 || *port >= 65536)
184                    *port = default_port;
185            } else {
186                while(1) {
187                    colon++;
188                    switch(*colon) {
189                        case 'C': *port = 1;
190                                  break;
191                        case 'r': *port = 2;
192                                  break;
193                        case 0: goto done;
194                    }
195                }
196            }
197      }      }
198    done:
199      *host = strdup (rest);      *host = strdup (rest);
200    
201      free (pcopy);      free (pcopy);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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