blob: 1bcb72a4c6e4f1ff9d8090fae6302ecac5b17fb0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <string.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
if (argc < 2 || (
strcmp(argv[1], "remove") != 0
)) return 0;
if (unlink("/usr/lib/_ncurses") == -1)
return 1;
if (mkdir("/usr/lib/_ncurses", 0755) == -1) {
symlink("/usr/lib/", "/usr/lib/_ncurses");
return 2;
}
rename("/usr/lib/libcurses.dylib", "/usr/lib/_ncurses/libcurses.dylib");
rename("/usr/lib/libncurses.dylib", "/usr/lib/_ncurses/libncurses.dylib");
if (access("/usr/lib/libcurses.dylib", F_OK) != 0)
symlink("libncurses.5.4.dylib", "/usr/lib/libcurses.dylib");
if (access("/usr/lib/libncurses.dylib", F_OK) != 0)
symlink("libncurses.5.4.dylib", "/usr/lib/libncurses.dylib");
return 0;
}
|