diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-17 23:33:56 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-03-17 23:33:56 +1300 |
commit | cff2863f6b986490c5868bb177918666432c9f4c (patch) | |
tree | 779a9b12410883feee57b42cc287692893473808 | |
parent | Free memory in ls(1) too (diff) | |
download | tunics-cff2863f6b986490c5868bb177918666432c9f4c.tar.gz tunics-cff2863f6b986490c5868bb177918666432c9f4c.zip |
Quick and utterly wrong pwd(1) implementation
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | pwd.c | 9 | ||||
-rw-r--r-- | pwd.h | 8 |
4 files changed, 20 insertions, 2 deletions
@@ -1,2 +1,3 @@ ls +pwd sort @@ -3,9 +3,9 @@ CC = clang CFLAGS = -std=c90 -Weverything -all : ls sort +all : ls pwd sort clean : rm -f -- *.o - rm -f ls sort + rm -f ls pwd sort @@ -0,0 +1,9 @@ +#include "pwd.h" + +int main(void) +{ + char buf[1024]; + fprintf(stdout, "%s\n", getcwd(buf, 1024)); + exit(EXIT_SUCCESS); +} + @@ -0,0 +1,8 @@ +#ifndef __PWD_H +#define __PWD_H + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#endif |