2
0

Compare commits

...

2 Commits

Author SHA1 Message Date
2ae359b04a [doc] fix ino/dev field in lua stat, add lighty.path_simplify to global methods
Change-Id: I76ad8233d0ea1a934d0812c9a8c93fa97317344d
2021-08-12 17:12:04 +02:00
f25bc4106f [core] fix li_path_simplify comment: always operating in-place
Change-Id: Idb657f798516b0d2ed53fb0b2cfecbcbbe801c00
2021-08-12 17:11:28 +02:00
2 changed files with 4 additions and 6 deletions

View File

@ -178,6 +178,7 @@
* @lighty.md5(str)@: calculates the md5 checksum of the string @str@ (returns the digest as string in hexadecimal) * @lighty.md5(str)@: calculates the md5 checksum of the string @str@ (returns the digest as string in hexadecimal)
* @lighty.sha1(str)@: calculates the sha1 checksum of the string @str@ (returns the digest as string in hexadecimal) * @lighty.sha1(str)@: calculates the sha1 checksum of the string @str@ (returns the digest as string in hexadecimal)
* @lighty.sha256(str)@: calculates the sha256 checksum of the string @str@ (returns the digest as string in hexadecimal) * @lighty.sha256(str)@: calculates the sha256 checksum of the string @str@ (returns the digest as string in hexadecimal)
* @lighty.path_simplify(str)@: return simplified path
]]></textile> ]]></textile>
<example> <example>
@ -346,7 +347,7 @@
<section title="Stat struct"> <section title="Stat struct">
<textile><![CDATA[ <textile><![CDATA[
Represents "struct stat". Most fields should be self explaining (@man stat@ if you don't know them). Represents "struct stat". Most fields should be self explaining (@man 2 stat@ ("debian manpage":https://manpages.debian.org/stat.2.en.html) if you don't know them).
Fields: Fields:
* @is_file@(ro): S_ISREG(mode) * @is_file@(ro): S_ISREG(mode)
@ -364,7 +365,7 @@
* @gid@(ro) * @gid@(ro)
* @size@(ro) * @size@(ro)
* @ino@(ro) * @ino@(ro)
* @ino@(ro) * @dev@(ro)
]]></textile> ]]></textile>
</section> </section>
</section> </section>

View File

@ -358,9 +358,6 @@ void li_url_decode(GString *path) {
* /blah/../foo gets /foo * /blah/../foo gets /foo
* /abc/./xyz gets /abc/xyz * /abc/./xyz gets /abc/xyz
* /abc//xyz gets /abc/xyz * /abc//xyz gets /abc/xyz
*
* NOTE: src and dest can point to the same buffer, in which case
* the operation is performed in-place.
*/ */
void li_path_simplify(GString *path) { void li_path_simplify(GString *path) {
@ -372,7 +369,7 @@ void li_path_simplify(GString *path) {
if (path == NULL) if (path == NULL)
return; return;
walk = start = out = slash = path->str; walk = start = out = slash = path->str;
while (*walk == ' ') { while (*walk == ' ') {
walk++; walk++;
} }