Changeset 31 in dev for BasicCompiler_Common/StrOperation.cpp
- Timestamp:
- Jan 13, 2007, 4:26:50 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/StrOperation.cpp
r15 r31 704 704 return 0; 705 705 } 706 707 void ShortPathToLongPath(const char *ShortPath,char *LongPath){ 708 HANDLE hFind; 709 WIN32_FIND_DATA wfd; 710 int i; 711 char dummy[MAX_PATH]; 712 for(i=0;i<MAX_PATH;i++){ 713 LongPath[i]=ShortPath[i]; 714 if((ShortPath[i-1]==':'&&ShortPath[i]=='\\')||(ShortPath[i-1]=='\\'&&ShortPath[i]=='\\')){ 715 LongPath[i+1]=0; 716 break; 717 } 718 } 719 if(ShortPath[i-1]=='\\'&&ShortPath[i]=='\\'){ 720 for(i++;i<MAX_PATH;i++){ 721 if(IsDBCSLeadByte(ShortPath[i])){ 722 i++; 723 continue; 724 } 725 LongPath[i]=ShortPath[i]; 726 if(ShortPath[i]=='\\'){ 727 LongPath[i+1]=0; 728 break; 729 } 730 } 731 for(i++;i<MAX_PATH;i++){ 732 if(IsDBCSLeadByte(ShortPath[i])){ 733 i++; 734 continue; 735 } 736 LongPath[i]=ShortPath[i]; 737 if(ShortPath[i]=='\\'){ 738 LongPath[i+1]=0; 739 break; 740 } 741 } 742 } 743 for(i++;i<MAX_PATH;i++){ 744 if(IsDBCSLeadByte(ShortPath[i])){ 745 i++; 746 continue; 747 } 748 if(ShortPath[i]=='\\'||ShortPath[i]=='\0'){ 749 strncpy(dummy,ShortPath,i); 750 dummy[i]=0; 751 if((hFind=FindFirstFile(dummy,&wfd))!=INVALID_HANDLE_VALUE) FindClose(hFind); 752 lstrcat(LongPath,wfd.cFileName); 753 754 if(ShortPath[i]=='\0') break; 755 lstrcat(LongPath,"\\"); 756 757 if(ShortPath[i]=='\\'&&ShortPath[i+1]=='\0'){ 758 break; 759 } 760 } 761 } 762 }
Note:
See TracChangeset
for help on using the changeset viewer.