Fossil

Check-in [93d52a01]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge in small fixes to the test suite and plan to continue improving the suite in the trunk. Also kludge login.c on MinGW which has no strtok_r() available in its libc by supplying a public domain one. There certainly is a better way to deal with this, but this unbreaks the build on Windows broken by [315cf2436].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:93d52a010f07a08ceea61aed4eadd53632ebd4338c024678f581e2835a612ff8
User & Date: rberteig 2017-03-14 01:55:39
Context
2017-03-14
12:11
Fix Debian bug 847556: Cannot clone/sync over HTTPS check-in: 04168f51 user: jan.nijtmans tags: trunk
01:55
Merge in small fixes to the test suite and plan to continue improving the suite in the trunk. Also kludge login.c on MinGW which has no strtok_r() available in its libc by supplying a public domain one. There certainly is a better way to deal with this, but this unbreaks the build on Windows broken by [315cf2436]. check-in: 93d52a01 user: rberteig tags: trunk
2017-03-13
23:47
Add the capability for Fossil to directly interpret the Authentication: HTTP header for Basic Authentication, if enabled on the /setup_access page. Disabled by default. check-in: 315cf243 user: drh tags: trunk
22:24
Merged from trunk for testing before pushing back to trunk. Closed-Leaf check-in: f955c632 user: rberteig tags: rkb-2.0-tests
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/login.c.

46
47
48
49
50
51
52






































53
54
55
56
57
58
59
#if defined(_WIN32)
#  include <windows.h>           /* for Sleep */
#  if defined(__MINGW32__) || defined(_MSC_VER)
#    define sleep Sleep            /* windows does not have sleep, but Sleep */
#  endif
#endif
#include <time.h>







































/*
** Return the login-group name.  Or return 0 if this repository is
** not a member of a login-group.
*/
const char *login_group_name(void){
  static const char *zGroup = 0;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#if defined(_WIN32)
#  include <windows.h>           /* for Sleep */
#  if defined(__MINGW32__) || defined(_MSC_VER)
#    define sleep Sleep            /* windows does not have sleep, but Sleep */
#  endif
#endif
#include <time.h>

#if defined(__MINGW32__) || defined(_MSC_VER)
/*
** MinGW doesn't have strtok_r in its libc. Here's a public domain one
** found at StackOverflow as a work-around, with formatting adjusted to
** make it more like the usual style here. This is certainly the wrong
** place for it, which is emphasized by making the function static.
** 
** See http://stackoverflow.com/a/12979321/68204
** 
** public domain strtok_r() by Charlie Gordon
**   from comp.lang.c  9/14/2007
**   http://groups.google.com/group/comp.lang.c/msg/2ab1ecbb86646684
** (Declaration that it's public domain):
**   http://groups.google.com/group/comp.lang.c/msg/7c7b39328fefab9c
*/
static char* strtok_r(
  char *str, 
  const char *delim, 
  char **nextp
){
  char *ret;
  if( str == NULL ){
    str = *nextp;
  }
  str += strspn(str, delim);
  if( *str == '\0' ){
    return NULL;
  }
  ret = str;
  str += strcspn(str, delim);
  if( *str ){
    *str++ = '\0';
  }
  *nextp = str;
  return ret;
}
#endif

/*
** Return the login-group name.  Or return 0 if this repository is
** not a member of a login-group.
*/
const char *login_group_name(void){
  static const char *zGroup = 0;

Changes to test/json.test.

747
748
749
750
751
752
753
754
755
756

757
758
759
760
761
762
763
764
procTimeMs resultCode resultText} {payload}
test json-env-RC-1102-code {[dict get $JR resultCode] eq "FOSSIL-1102"}


# FOSSIL-1103 FSL_JSON_E_UNKNOWN
#     Unknown error

write_file bad.sql  {
CREATE TABLE spam(a integer, b text);
}

exec $::fossilexe sqlite3 --no-repository bad.fossil <bad.sql
#fossil_json HAI -R bad.fossil -expectError

# FOSSIL-1104 FSL_JSON_E_TIMEOUT
#     Timeout reached
# FOSSIL-1105 FSL_JSON_E_ASSERT
#     Assertion failed
# FOSSIL-1106 FSL_JSON_E_ALLOC







|
|
<
>
|







747
748
749
750
751
752
753
754
755

756
757
758
759
760
761
762
763
764
procTimeMs resultCode resultText} {payload}
test json-env-RC-1102-code {[dict get $JR resultCode] eq "FOSSIL-1102"}


# FOSSIL-1103 FSL_JSON_E_UNKNOWN
#     Unknown error

#write_file bad.sql  {
#CREATE TABLE spam(a integer, b text);

#}
#exec $::fossilexe sqlite3 --no-repository bad.fossil <bad.sql
#fossil_json HAI -R bad.fossil -expectError

# FOSSIL-1104 FSL_JSON_E_TIMEOUT
#     Timeout reached
# FOSSIL-1105 FSL_JSON_E_ASSERT
#     Assertion failed
# FOSSIL-1106 FSL_JSON_E_ALLOC

Changes to test/wiki.test.

19
20
21
22
23
24
25


26
27
28



29
30
31

32
33
34
35
36
37
38
#

test_setup

# Return true if two files are similar (i.e. not only compress trailing spaces
# from a line, but remove any final LF from the file as well)
proc similar_file {a b} {


  set x [read_file $a]
  regsub -all { +\n} $x \n x
  regsub -all {\n$} $x {} x



  set y [read_file $b]
  regsub -all { +\n} $y \n y
  regsub -all {\n$} $y {} y

  return [expr {$x==$y}]
}

# Return the mime type in the manifest for a given wiki page
# Defaults to "error: some text" if the manifest can't be located and
# "text/x-fossil-wiki" (the default mimetype for rendering)
# if the N card is omitted in the manifest.







>
>
|
|
|
>
>
>
|
|
|
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#

test_setup

# Return true if two files are similar (i.e. not only compress trailing spaces
# from a line, but remove any final LF from the file as well)
proc similar_file {a b} {
  set x ""
  if {[file exists $a]} {
    set x [read_file $a]
    regsub -all { +\n} $x \n x
    regsub -all {\n$} $x {} x
  }
  set y ""
  if {[file exists $b]} {
    set y [read_file $b]
    regsub -all { +\n} $y \n y
    regsub -all {\n$} $y {} y
  }
  return [expr {$x==$y}]
}

# Return the mime type in the manifest for a given wiki page
# Defaults to "error: some text" if the manifest can't be located and
# "text/x-fossil-wiki" (the default mimetype for rendering)
# if the N card is omitted in the manifest.