small bugfixes; documentation generator supports smilies for the forum

This commit is contained in:
Araq
2012-05-01 11:14:29 +02:00
parent ccae314635
commit e95f155af3
11 changed files with 229 additions and 84 deletions

View File

@@ -106,7 +106,7 @@ proc getRow*(db: TDbConn, query: TSqlQuery,
var sqlres = mysql.UseResult(db)
if sqlres != nil:
var L = int(mysql.NumFields(sqlres))
var result = newRow(L)
result = newRow(L)
var row = mysql.FetchRow(sqlres)
if row != nil:
for i in 0..L-1:

View File

@@ -108,7 +108,7 @@ proc getRow*(db: TDbConn, query: TSqlQuery,
## retrieves a single row.
var res = setupQuery(db, query, args)
var L = int(PQnfields(res))
var result = newRow(L)
result = newRow(L)
setRow(res, result, 0, L)
PQclear(res)

View File

@@ -106,7 +106,7 @@ proc getRow*(db: TDbConn, query: TSqlQuery,
## retrieves a single row.
var stmt = setupQuery(db, query, args)
var L = int(columnCount(stmt))
var result = newRow(L)
result = newRow(L)
if step(stmt) == SQLITE_ROW:
setRow(stmt, result, L)
if finalize(stmt) != SQLITE_OK: dbError(db)

View File

@@ -222,7 +222,7 @@ macro head*(e: expr): expr =
macro html*(e: expr): expr =
## generates the HTML ``html`` element.
result = xmlCheckedTag(e, "html", "", "xmlns")
result = xmlCheckedTag(e, "html", "xmlns", "")
macro hr*(e: expr): expr =
## generates the HTML ``hr`` element.

View File

@@ -531,6 +531,16 @@ proc endsWith*(s, suffix: string): bool {.noSideEffect,
if s[i+j] != suffix[i]: return false
inc(i)
if suffix[i] == '\0': return true
proc continuesWith*(s, substr: string, start: int): bool {.noSideEffect,
rtl, extern: "nsuContinuesWith".} =
## Returns true iff ``s`` continues with ``substr`` at position ``start``.
## If ``substr == ""`` true is returned.
var i = 0
while true:
if substr[i] == '\0': return true
if s[i+start] != substr[i]: return false
inc(i)
proc addSep*(dest: var string, sep = ", ", startLen = 0) {.noSideEffect,
inline.} =