main.c (cdf0e10c) | main.c (26d9e9dd) |
---|---|
1/* $XConsortium: main.c,v 1.84 94/11/30 16:10:44 kaleb Exp $ */ 2/* $XFree86: xc/config/makedepend/main.c,v 3.4 1995/07/15 14:53:49 dawes Exp $ */ 3/* 4 5Copyright (c) 1993, 1994 X Consortium 6 7Permission is hereby granted, free of charge, to any person obtaining a copy 8of this software and associated documentation files (the "Software"), to deal --- 619 unchanged lines hidden (view full) --- 628 629 if (*p == '.') 630 *p = '\0'; 631 632 while (p > file) { 633 if ( *p == '/' || *p == '\\') { 634 file = p + 1; 635 break; | 1/* $XConsortium: main.c,v 1.84 94/11/30 16:10:44 kaleb Exp $ */ 2/* $XFree86: xc/config/makedepend/main.c,v 3.4 1995/07/15 14:53:49 dawes Exp $ */ 3/* 4 5Copyright (c) 1993, 1994 X Consortium 6 7Permission is hereby granted, free of charge, to any person obtaining a copy 8of this software and associated documentation files (the "Software"), to deal --- 619 unchanged lines hidden (view full) --- 628 629 if (*p == '.') 630 *p = '\0'; 631 632 while (p > file) { 633 if ( *p == '/' || *p == '\\') { 634 file = p + 1; 635 break; |
636 }; | 636 } |
637 p--; | 637 p--; |
638 }; | 638 } |
639 return(file); 640} 641 642#if defined(USG) && !defined(CRAY) && !defined(SVR4) 643int rename (from, to) 644 char *from, *to; 645{ 646 (void) unlink (to); --- 122 unchanged lines hidden (view full) --- 769 if (native_win_slashes) { 770 for (ptr = (char*)path; *ptr; ++ptr) 771 if (*ptr == '/') 772 *ptr = '\\'; 773 } else { 774 for (ptr = (char*)path; *ptr; ++ptr) 775 if (*ptr == '\\') 776 *ptr = '/'; | 639 return(file); 640} 641 642#if defined(USG) && !defined(CRAY) && !defined(SVR4) 643int rename (from, to) 644 char *from, *to; 645{ 646 (void) unlink (to); --- 122 unchanged lines hidden (view full) --- 769 if (native_win_slashes) { 770 for (ptr = (char*)path; *ptr; ++ptr) 771 if (*ptr == '/') 772 *ptr = '\\'; 773 } else { 774 for (ptr = (char*)path; *ptr; ++ptr) 775 if (*ptr == '\\') 776 *ptr = '/'; |
777 }; | 777 } |
778#else 779 (void)path; 780#endif 781} 782 783char* append_slash(path) 784 char* path; 785{ 786 char *new_string; 787 if ((path[strlen(path) - 1] == '/') || (path[strlen(path) - 1] == '\\')) { 788 new_string = path; 789 } else { 790 new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2)); 791 strcpy(new_string, path); 792 if (native_win_slashes) 793 strcat(new_string, "\\"); 794 else 795 strcat(new_string, "/"); | 778#else 779 (void)path; 780#endif 781} 782 783char* append_slash(path) 784 char* path; 785{ 786 char *new_string; 787 if ((path[strlen(path) - 1] == '/') || (path[strlen(path) - 1] == '\\')) { 788 new_string = path; 789 } else { 790 new_string = (char*)malloc(sizeof(char) * (strlen(path) + 2)); 791 strcpy(new_string, path); 792 if (native_win_slashes) 793 strcat(new_string, "\\"); 794 else 795 strcat(new_string, "/"); |
796 }; | 796 } |
797 return new_string; 798} 799 | 797 return new_string; 798} 799 |