Fossil SCM
Hostname prefix on the repository name for the "fossil ui" command must be at least two characters in length, to avoid confusing it with a drive letter on windows.
Commit
385344eff7b03638c70cd940b9d2323b01654caf3565fd145e616c616dca805b
Parent
a3392298c341e51…
1 file changed
+4
-1
+4
-1
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -923,21 +923,24 @@ | ||
| 923 | 923 | ** Remote files look like: "HOST:PATH" or "USER@HOST:PATH". Host must |
| 924 | 924 | ** be a valid hostname, meaning it must follow these rules: |
| 925 | 925 | ** |
| 926 | 926 | ** * Only characters [-.a-zA-Z0-9]. No spaces or other punctuation |
| 927 | 927 | ** * Does not begin or end with - |
| 928 | +** * Name is two or more characters long (otherwise it might be | |
| 929 | +** confused with a drive-letter on Windows). | |
| 928 | 930 | ** |
| 929 | -** The USER section, it it exists, must not contain the '@' character. | |
| 931 | +** The USER section, if it exists, must not contain the '@' character. | |
| 930 | 932 | */ |
| 931 | 933 | const char *file_skip_userhost(const char *zIn){ |
| 932 | 934 | const char *zTail; |
| 933 | 935 | int n, i; |
| 934 | 936 | if( zIn[0]==':' ) return 0; |
| 935 | 937 | zTail = strchr(zIn, ':'); |
| 936 | 938 | if( zTail==0 ) return 0; |
| 937 | 939 | if( zTail - zIn > 10000 ) return 0; |
| 938 | 940 | n = (int)(zTail - zIn); |
| 941 | + if( n<2 ) return 0; | |
| 939 | 942 | if( zIn[n-1]=='-' || zIn[n-1]=='.' ) return 0; |
| 940 | 943 | for(i=n-1; i>0 && zIn[i-1]!='@'; i--){ |
| 941 | 944 | if( !fossil_isalnum(zIn[i]) && zIn[i]!='-' && zIn[i]!='.' ) return 0; |
| 942 | 945 | } |
| 943 | 946 | if( zIn[i]=='-' || zIn[i]=='.' || i==1 ) return 0; |
| 944 | 947 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -923,21 +923,24 @@ | |
| 923 | ** Remote files look like: "HOST:PATH" or "USER@HOST:PATH". Host must |
| 924 | ** be a valid hostname, meaning it must follow these rules: |
| 925 | ** |
| 926 | ** * Only characters [-.a-zA-Z0-9]. No spaces or other punctuation |
| 927 | ** * Does not begin or end with - |
| 928 | ** |
| 929 | ** The USER section, it it exists, must not contain the '@' character. |
| 930 | */ |
| 931 | const char *file_skip_userhost(const char *zIn){ |
| 932 | const char *zTail; |
| 933 | int n, i; |
| 934 | if( zIn[0]==':' ) return 0; |
| 935 | zTail = strchr(zIn, ':'); |
| 936 | if( zTail==0 ) return 0; |
| 937 | if( zTail - zIn > 10000 ) return 0; |
| 938 | n = (int)(zTail - zIn); |
| 939 | if( zIn[n-1]=='-' || zIn[n-1]=='.' ) return 0; |
| 940 | for(i=n-1; i>0 && zIn[i-1]!='@'; i--){ |
| 941 | if( !fossil_isalnum(zIn[i]) && zIn[i]!='-' && zIn[i]!='.' ) return 0; |
| 942 | } |
| 943 | if( zIn[i]=='-' || zIn[i]=='.' || i==1 ) return 0; |
| 944 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -923,21 +923,24 @@ | |
| 923 | ** Remote files look like: "HOST:PATH" or "USER@HOST:PATH". Host must |
| 924 | ** be a valid hostname, meaning it must follow these rules: |
| 925 | ** |
| 926 | ** * Only characters [-.a-zA-Z0-9]. No spaces or other punctuation |
| 927 | ** * Does not begin or end with - |
| 928 | ** * Name is two or more characters long (otherwise it might be |
| 929 | ** confused with a drive-letter on Windows). |
| 930 | ** |
| 931 | ** The USER section, if it exists, must not contain the '@' character. |
| 932 | */ |
| 933 | const char *file_skip_userhost(const char *zIn){ |
| 934 | const char *zTail; |
| 935 | int n, i; |
| 936 | if( zIn[0]==':' ) return 0; |
| 937 | zTail = strchr(zIn, ':'); |
| 938 | if( zTail==0 ) return 0; |
| 939 | if( zTail - zIn > 10000 ) return 0; |
| 940 | n = (int)(zTail - zIn); |
| 941 | if( n<2 ) return 0; |
| 942 | if( zIn[n-1]=='-' || zIn[n-1]=='.' ) return 0; |
| 943 | for(i=n-1; i>0 && zIn[i-1]!='@'; i--){ |
| 944 | if( !fossil_isalnum(zIn[i]) && zIn[i]!='-' && zIn[i]!='.' ) return 0; |
| 945 | } |
| 946 | if( zIn[i]=='-' || zIn[i]=='.' || i==1 ) return 0; |
| 947 |