mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +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
This commit is contained in:
@@ -2708,6 +2708,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) {
|
||||
|
||||
std::string path = hh->ParamList["path"];
|
||||
if ((dirp = opendir(path.c_str()))) {
|
||||
bool isFirstLine = true;
|
||||
while ((entry = readdir(dirp))) {
|
||||
std::string item = "";
|
||||
item += hh->outPair("name",
|
||||
@@ -2769,7 +2770,11 @@ void CControlAPI::FileCGI(CyhookHandler *hh) {
|
||||
string_printf("%ld", (long) statbuf.st_mtime),
|
||||
false);
|
||||
}
|
||||
result += hh->outArrayItem("item", item, true);
|
||||
if(isFirstLine)
|
||||
isFirstLine = false;
|
||||
else
|
||||
result += hh->outNext();
|
||||
result += hh->outArrayItem("item", item, false);
|
||||
}
|
||||
closedir(dirp);
|
||||
}
|
||||
|
Reference in New Issue
Block a user