/[gcl]/gcl/o/mingwin.c
ViewVC logotype

Diff of /gcl/o/mingwin.c

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

revision 1.7 by mjthomas, Tue Feb 18 02:32:03 2003 UTC revision 1.8 by mjthomas, Tue Feb 25 04:41:50 2003 UTC
# Line 935  fix_filename(object pathname, char *file Line 935  fix_filename(object pathname, char *file
935          if (*p=='\\') *p='/';          if (*p=='\\') *p='/';
936          p++;          p++;
937      }      }
  AGAIN:  
938      /* grok filename to have only '/' not '\',      /* grok filename to have only '/' not '\',
939         fix up for cygnus:  /cygdrive/h/   becomes h:/         fix up for cygnus:  /cygdrive/h/   becomes h:/
940         //h/ab and /h/ab become h:/ab         //h/ab and /h/ab become h:/ab
# Line 974  fix_filename(object pathname, char *file Line 973  fix_filename(object pathname, char *file
973          }          }
974      }      }
975    
976      if ( filename[1] == ':' && filename[2] != '/' ) {      /* If the drive is just a letter with a colon eg "c:" or "c:hello.txt" it needs to
977         * be resolved to the current directory on that device */
978        if ( ( filename[1] == ':' ) && (( strlen ( filename ) == 2 ) || ( filename[2] != '/' ) ) ) {
979          char buf[4];          char buf[4];
980            int len;
981          /*        fprintf ( stderr, "fix_filename: In current dir fixup phase\n" );*/          /*        fprintf ( stderr, "fix_filename: In current dir fixup phase\n" );*/
982          bcopy(filename,buf,2);          bcopy(filename,buf,2);
983          buf[2]='/';          buf[2]='/';
984          buf[3]=0;          buf[3]=0;
985          getwd(current_directory);          getwd(current_directory);
986          if ( chdir(buf) < 0 ) {          len = strlen ( current_directory );
987              FEerror("fix_filename: Cannot get the truename of ~S.", 1, pathname);          strcpy ( directory, filename );
988          }          strncpy ( filename, current_directory, MAXPATHLEN-1 );
989          p = getwd ( directory );          filename[len]='/';
990          chdir ( current_directory );          filename[len+1]='\0';
991          strncat ( directory, filename+2, MAXPATHLEN-strlen(directory)-2 );          strncat ( filename, directory+2, MAXPATHLEN - 2 - strlen ( current_directory ) );
992          strcpy ( filename1, directory );          filename [MAXPATHLEN-1] = '\0';
993          filename = filename1;          filename = filename1;
994          goto AGAIN;          p = filename;
995            while ( *p ) {
996                if (*p=='\\') *p='/';
997                p++;
998            }
999      }      }
1000    
1001      /* move the name back to beginning of buffer */      /* move the name back to beginning of buffer */

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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