On Tue, Oct 23, 2012 at 11:36:34PM +0000, K wrote:
> >>Is someone able to explain to me why there is a 3-character minimum to wiki
> >>names? This seems to me like a strange arbitrary constraint to impose.
>
>
> >The minimum-3-chararacter rule is subjective. When I wrote Fossil (6 years
> >ago) it never occurred to me that anybody would want a wiki page name of
> >less than 3 characters.
>
> >The patch to relax that rule should be trivial.
>
>
> I just tried fossil 1.24 and wiki pages still must be 3 characters or
> greater. I would appreciate receiving instruction on how to go about getting
> this changed to a lower number of characters. I personally would suggest a
> minimum of 1 character as I find anything greater to be arbitrary.
>
> Please advise.
>
> Kind regards,
> ^K
K,
The attached diff should decrease the limit to 1 character.
--
James Turner
[email protected]
Index: src/wiki.c
==================================================================
--- src/wiki.c
+++ src/wiki.c
@@ -27,11 +27,11 @@
** Return true if the input string is a well-formed wiki page name.
**
** Well-formed wiki page names do not begin or end with whitespace,
** and do not contain tabs or other control characters and do not
** contain more than a single space character in a row. Well-formed
-** names must be between 3 and 100 chracters in length, inclusive.
+** names must be between 1 and 100 chracters in length, inclusive.
*/
int wiki_name_is_wellformed(const unsigned char *z){
int i;
if( z[0]<=0x20 ){
return 0;
@@ -39,11 +39,11 @@
for(i=1; z[i]; i++){
if( z[i]<0x20 ) return 0;
if( z[i]==0x20 && z[i-1]==0x20 ) return 0;
}
if( z[i-1]==' ' ) return 0;
- if( i<3 || i>100 ) return 0;
+ if( i<1 || i>100 ) return 0;
return 1;
}
/*
** Output rules for well-formed wiki pages
@@ -52,11 +52,11 @@
@ <ul>
@ <li> Must not begin or end with a space.</li>
@ <li> Must not contain any control characters, including tab or
@ newline.</li>
@ <li> Must not have two or more spaces in a row internally.</li>
- @ <li> Must be between 3 and 100 characters in length.</li>
+ @ <li> Must be between 1 and 100 characters in length.</li>
@ </ul>
}
/*
** Check a wiki name. If it is not well-formed, then issue an error
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users