Compare commits

...

2 Commits

Author SHA1 Message Date
Stefan Bühler 2ae359b04a [doc] fix ino/dev field in lua stat, add lighty.path_simplify to global methods 2 months ago
Stefan Bühler f25bc4106f [core] fix li_path_simplify comment: always operating in-place 2 months ago
  1. 5
      doc/core_lua.xml
  2. 5
      src/common/utils.c

5
doc/core_lua.xml

@ -178,6 +178,7 @@
* @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.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>
<example>
@ -346,7 +347,7 @@
<section title="Stat struct">
<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:
* @is_file@(ro): S_ISREG(mode)
@ -364,7 +365,7 @@
* @gid@(ro)
* @size@(ro)
* @ino@(ro)
* @ino@(ro)
* @dev@(ro)
]]></textile>
</section>
</section>

5
src/common/utils.c

@ -358,9 +358,6 @@ void li_url_decode(GString *path) {
* /blah/../foo gets /foo
* /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) {
@ -372,7 +369,7 @@ void li_path_simplify(GString *path) {
if (path == NULL)
return;
walk = start = out = slash = path->str;
walk = start = out = slash = path->str;
while (*walk == ' ') {
walk++;
}

Loading…
Cancel
Save