cleanup warning in custom layout

This commit is contained in:
speedie 2022-12-04 22:31:11 +01:00
parent 3a7ea6f575
commit 2e3724de4c

View file

@ -1640,8 +1640,11 @@ set_s_layout(const Arg *arg)
/* make sure the history file exists */
hf = fopen(customhistfile, "a"); fclose(hf);
system("sort" customhistfile " | uniq > " customhistfile "~");
system("mv " customhistfile "~ " customhistfile);
if (!system("sort" customhistfile " | uniq > " customhistfile "~"))
return;
if (!system("mv " customhistfile "~ " customhistfile))
return;
pp = popen(customprompt customhistfile, "r");
} else {