Ticket #304: remove-trailing-dots.diff
File remove-trailing-dots.diff, 674 bytes (added by , 10 years ago) |
---|
-
src/lib/sys/fs.c
817 817 } 818 818 } 819 819 820 /* Remove trailing dots except all dots. */ 821 pszTrg = pszPath + cch - 1; 822 823 /* 824 * pszPath is an absolute path, that is, it has one '/' at least. 825 * So, there is no need to check a boundary of pszTrg. 826 */ 827 while (*pszTrg == '.') 828 *pszTrg--; 829 830 /* Trailing dots ? Then remove them. */ 831 if (*pszTrg != '/') 832 cch = pszTrg - pszPath + 1; 833 834 pszPath[cch] = '\0'; 835 820 836 return cch; 821 837 } 822 838