Skip to content

Commit

Permalink
src-worddic: Replace mkdir() with anthy_mkdir_with_parents()
Browse files Browse the repository at this point in the history
anthy_check_user_dir() creates a user directory and needs
"mkdir -p" function to create dicrectories recursively.
  • Loading branch information
fujiwarat committed Nov 9, 2020
1 parent 4d0c11d commit f59ccfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src-util/dic-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,13 @@
#include <time.h>

#include <anthy/anthy.h>
#include <anthy/diclib.h>
#include <anthy/dicutil.h>
/**/
#include <anthy/textdict.h>
#include <anthy/xstr.h>
#include "config.h"

#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif

#define UNSPEC 0
#define DUMP_DIC 1
#define LOAD_DIC 2
Expand Down
3 changes: 2 additions & 1 deletion src-worddic/priv_dic.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <anthy/anthy.h>
#include <anthy/alloc.h>
#include <anthy/dic.h>
#include <anthy/diclib.h>
#include <anthy/record.h>
#include <anthy/dicutil.h>
#include <anthy/conf.h>
Expand Down Expand Up @@ -106,7 +107,7 @@ anthy_check_user_dir(void)
if (stat(dn, &st) || !S_ISDIR(st.st_mode)) {
int r;
/*fprintf(stderr, "Anthy: Failed to open anthy directory(%s).\n", dn);*/
r = mkdir(dn, S_IRWXU);
r = anthy_mkdir_with_parents(dn, S_IRWXU);
if (r == -1){
anthy_log(0, "Failed to create profile directory\n");
return ;
Expand Down

0 comments on commit f59ccfd

Please sign in to comment.