command-not-found: Use arch-specific command list

This commit is contained in:
Fredrik Fornwall 2018-09-29 10:44:22 +02:00
parent 2b61e3a317
commit c3175fe791
6 changed files with 11654 additions and 1889 deletions

View File

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=https://termux.com
TERMUX_PKG_DESCRIPTION="Suggest installation of packages in interactive shell sessions"
TERMUX_PKG_VERSION=1.34
TERMUX_PKG_VERSION=1.35
termux_step_make_install () {
TERMUX_LIBEXEC_DIR=$TERMUX_PREFIX/libexec/termux

View File

@ -2,7 +2,19 @@
#include <string.h>
#include <stdbool.h>
#include "commands.h"
char const* const commands[] = {
#ifdef __aarch64__
# include "commands-aarch64.h"
#elif defined __arm__
# include "commands-arm.h"
#elif defined __x86_64__
# include "commands-x86_64.h"
#elif defined __i686__
# include "commands-i686.h"
#else
# error Failed to detect arch
#endif
};
static inline int termux_min3(unsigned int a, unsigned int b, unsigned int c) {
return (a < b ? (a < c ? a : c) : (b < c ? b : c));
@ -52,7 +64,7 @@ int main(int argc, char** argv) {
} else if (best_distance == distance) {
guesses_at_best_distance++;
} else if (best_distance == -1 || best_distance > distance) {
guesses_at_best_distance = 0;
guesses_at_best_distance = 1;
best_distance = distance;
strncpy(best_command_guess, binary_name, sizeof(best_command_guess));
strncpy(best_package_guess, current_package, sizeof(best_package_guess));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff