|
@@ -9098,8 +9098,8 @@ compare_dir_entries(const void *p1, const void *p2)
|
|
|
const char *query_string = a->conn->request_info.query_string;
|
|
|
int cmp_result = 0;
|
|
|
|
|
|
- if (query_string == NULL) {
|
|
|
- query_string = "na";
|
|
|
+ if ((query_string == NULL) || (query_string[0] == '\0')) {
|
|
|
+ query_string = "n";
|
|
|
}
|
|
|
|
|
|
if (a->file.is_directory && !b->file.is_directory) {
|
|
@@ -9333,6 +9333,7 @@ handle_directory_request(struct mg_connection *conn, const char *dir)
|
|
|
}
|
|
|
|
|
|
sort_direction = ((conn->request_info.query_string != NULL)
|
|
|
+ && (conn->request_info.query_string[0] != '\0')
|
|
|
&& (conn->request_info.query_string[1] == 'd'))
|
|
|
? 'a'
|
|
|
: 'd';
|