BarryServer : Git

All the code for all my projects
// BarryServer : Git / OrionUserland / commit / 2e110925c3be315a94bfbf15cecbdaa0746bfe32 / sh / main.c

// Related

OrionUserland

Barry Using POSIX names in structs 2e11092 (2 years, 4 months ago)
diff --git a/sh/main.c b/sh/main.c
index d1319ad..f4c93d2 100644
--- a/sh/main.c
+++ b/sh/main.c
@@ -14,7 +14,7 @@
 
 #define PS1 "\033[1;31m%s\033[0m@\033[1m%s\033[0m:\033[1;32m%s\033[0m$> "
 
-int argparser(char *str, char **res);
+int argparser(char sep, char *str, char **res);
 
 /* Get the nice current working directory */
 static void
@@ -35,7 +35,6 @@ main(int argc, char *argv[])
 {
 	int fd, sz, i;
 	char *buf;
-	struct stat statbuf;
 	struct dirent *de;
 
 	/* Get username */
@@ -44,8 +43,8 @@ main(int argc, char *argv[])
 	username = malloc(33);
 	homedir = malloc(PATH_MAX);
 	Passwd *pwd = getpwuid(uid);
-	strcpy(username, pwd->username);
-	strcpy(homedir, pwd->homedir);
+	strcpy(username, pwd->pw_name);
+	strcpy(homedir, pwd->pw_dir);
 
 	/* Get hostname */
 	hostname = malloc(HOST_NAME_MAX + 1);
@@ -72,7 +71,7 @@ main(int argc, char *argv[])
 		if (sz < 1)
 			continue;
 
-		count = argparser(line, v);
+		count = argparser(' ', line, v);
 
 		/* Change directory (built-in) */
 		if (!strcmp(v[0], "cd")) {