File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1136,11 +1136,20 @@ void save_config(Theme *theme, Game *game) {
1136
1136
}
1137
1137
fclose (f );
1138
1138
} else {
1139
+ char * user_rc_dir , * temp ;
1139
1140
char * system_rc_path = find_system_config_file ("csolrc" );
1140
1141
if (!system_rc_path ) {
1141
1142
print_error ("Error: No system configuration file found" );
1142
1143
return ;
1143
1144
}
1145
+ temp = strdup (user_rc_path );
1146
+ user_rc_dir = dirname (temp );
1147
+ if (!mkdir_rec (user_rc_dir )) {
1148
+ print_error ("Error: Unable to create configuration directory: %s: %s" , user_rc_dir , strerror (errno ));
1149
+ free (temp );
1150
+ return ;
1151
+ }
1152
+ free (temp );
1144
1153
f = fopen (user_rc_path , "wb" );
1145
1154
if (!f ) {
1146
1155
print_error ("Error: Unable to create configuration file: %s: %s" , user_rc_path , strerror (errno ));
You can’t perform that action at this time.
0 commit comments