commit - 17388298de0507aa98bcaaf59f77b736cf89920e
commit + 6150fab38e3d157bc176cc8321a5e4e8302ba6b8
blob - 9f40434650acf1a315a006c174c168a56e80e5c3
blob + 1d155f88c3be4d648736b9584bcf434a5f247fa7
--- ftp.c
+++ ftp.c
if (chdir(dir) == -1)
printf("cd: %s: %s\n", dir, strerror(errno));
+}
+
+static void
+cmd_lpwd(int argc, const char **argv)
+{
+ char path[PATH_MAX];
+
+ if (getcwd(path, sizeof(path)) == NULL) {
+ printf("lpwd: %s\n", strerror(errno));
+ return;
+ }
+
+ printf("%s\n", path);
}
static void
{"bell", cmd_bell},
{"bye", cmd_bye},
{"lcd", cmd_lcd},
+ {"lpwd", cmd_lpwd},
{"ls", cmd_ls},
{"quit", cmd_bye},
{"verbose", cmd_verbose},