dotfiles with stow
This commit is contained in:
17
config/.scripts/get_local_path.c
Normal file
17
config/.scripts/get_local_path.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 2) {
|
||||
return -1;
|
||||
}
|
||||
bool rel = true;
|
||||
if (argv[1][1] == '/') {
|
||||
rel = false;
|
||||
}
|
||||
char* last = strrchr(argv[1], '/');
|
||||
*last = '\0';
|
||||
puts(argv[1]);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user