diff lcdtest/showppm.c @ 19:f3671d3ad953

lcdtest: added cd command to avoid typing long pathnames for show
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 10 Apr 2018 23:37:19 +0000
parents 43cc53581975
children 1d8c499711f1
line wrap: on
line diff
--- a/lcdtest/showppm.c	Sat Apr 07 23:13:55 2018 +0000
+++ b/lcdtest/showppm.c	Tue Apr 10 23:37:19 2018 +0000
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 char *ppm_filename;
 FILE *ppmfile;
@@ -166,3 +167,13 @@
 	fclose(ppmfile);
 	return(0);
 }
+
+cmd_cd(argc, argv)
+	char **argv;
+{
+	if (chdir(argv[1]) < 0) {
+		perror(argv[1]);
+		return(-1);
+	}
+	return(0);
+}