mirror of
git://git.suckless.org/sbase
synced 2024-12-24 16:02:54 +00:00
23 lines
373 B
C
23 lines
373 B
C
|
/* See LICENSE file for copyright and license details. */
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <unistd.h>
|
||
|
#include "util.h"
|
||
|
|
||
|
int
|
||
|
main(void)
|
||
|
{
|
||
|
char *buf;
|
||
|
long size;
|
||
|
|
||
|
if((size = pathconf(".", _PC_PATH_MAX)) < 0)
|
||
|
size = BUFSIZ;
|
||
|
if(!(buf = malloc(size)))
|
||
|
eprintf("malloc:");
|
||
|
if(!getcwd(buf, size))
|
||
|
eprintf("getcwd:");
|
||
|
|
||
|
puts(buf);
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|