mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
nhttpd: file API remove last comma for JSON
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1685 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 3a437bb7d5
Author: yjogol <yjogol2@online.de>
Date: 2011-09-09 (Fri, 09 Sep 2011)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -2708,6 +2708,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) {
|
|||||||
|
|
||||||
std::string path = hh->ParamList["path"];
|
std::string path = hh->ParamList["path"];
|
||||||
if ((dirp = opendir(path.c_str()))) {
|
if ((dirp = opendir(path.c_str()))) {
|
||||||
|
bool isFirstLine = true;
|
||||||
while ((entry = readdir(dirp))) {
|
while ((entry = readdir(dirp))) {
|
||||||
std::string item = "";
|
std::string item = "";
|
||||||
item += hh->outPair("name",
|
item += hh->outPair("name",
|
||||||
@@ -2769,7 +2770,11 @@ void CControlAPI::FileCGI(CyhookHandler *hh) {
|
|||||||
string_printf("%ld", (long) statbuf.st_mtime),
|
string_printf("%ld", (long) statbuf.st_mtime),
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
result += hh->outArrayItem("item", item, true);
|
if(isFirstLine)
|
||||||
|
isFirstLine = false;
|
||||||
|
else
|
||||||
|
result += hh->outNext();
|
||||||
|
result += hh->outArrayItem("item", item, false);
|
||||||
}
|
}
|
||||||
closedir(dirp);
|
closedir(dirp);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user