Skip to content

Commit

Permalink
Add hunspell launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Apr 11, 2017
1 parent f885b3e commit b24edd7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions portacle.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ int launch_ash(char *root, int argc, char **argv){
return launch(path, argc, argv);
}

int launch_hunspell(char *root, int argc, char **argv){
char path[PATHLEN]={0};
if(!set_env("WORDLIST", pathcat(path, root, 2, "config", ".personal-dictionary"))) return 0;
if(!set_env("DICPATH", pathcat(path, root, 3, "all", "dictionaries", ""))) return 0;

pathcat(path, root, 3, PLATFORM, "hunspell", "bin", "hunspell");
return launch_maybe_ld(path, argc, argv);
}

int configure_env(char *root){
char path[PATHLEN]={0};

Expand Down Expand Up @@ -268,6 +277,11 @@ int main(int argc, char **argv){
fprintf(stderr, "Fatal: failed to launch ASH.\n");
return 2;
}
}else if(strcmp(app, "hunspell") == 0){
if(!launch_hunspell(root, argc, argv)){
fprintf(stderr, "Fatal: failed to launch HUNSPELL.\n");
return 2;
}
}else{
fprintf(stderr, "Fatal: Unknown application: %s\n", app);
return 3;
Expand Down

0 comments on commit b24edd7

Please sign in to comment.