17 lines
227 B
C
17 lines
227 B
C
|
#include <stdio.h>
|
||
|
#include <libgen.h>
|
||
|
|
||
|
int main(const int argc, const char **argv) {
|
||
|
|
||
|
if (argc <= 1) {
|
||
|
printf("dirname [dirname]\n");
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
for (int i = 1; i < argc; i++)
|
||
|
puts(dirname(argv[i]));
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|