This commit is contained in:
+1
-3
@@ -50,7 +50,7 @@ const char *file_completion(const char *path) {
|
|||||||
if (last_slash) {
|
if (last_slash) {
|
||||||
dir_len = last_slash - path + 1; // length of dir_path
|
dir_len = last_slash - path + 1; // length of dir_path
|
||||||
strncpy(directory, path, dir_len);
|
strncpy(directory, path, dir_len);
|
||||||
predict_len = strlen(path) - dir_len - 1;
|
predict_len = strlen(path) - dir_len;
|
||||||
strncpy(predict, last_slash + 1, predict_len);
|
strncpy(predict, last_slash + 1, predict_len);
|
||||||
directory[dir_len] = '\0';
|
directory[dir_len] = '\0';
|
||||||
predict[predict_len] = '\0';
|
predict[predict_len] = '\0';
|
||||||
@@ -73,8 +73,6 @@ const char *file_completion(const char *path) {
|
|||||||
strcat(full_path, "/"); // add slash for directories
|
strcat(full_path, "/"); // add slash for directories
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
dir = NULL;
|
|
||||||
free(entry);
|
|
||||||
|
|
||||||
return strdup(full_path);
|
return strdup(full_path);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user