mirror of
https://github.com/xorgy/mediafire-fuse
synced 2026-01-13 21:24:28 -08:00
initial commit - import mediafire-shell sources
This commit is contained in:
32
cmd_lpwd.c
Normal file
32
cmd_lpwd.c
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "mfshell.h"
|
||||
#include "private.h"
|
||||
|
||||
int
|
||||
mfshell_cmd_lpwd(mfshell_t *mfshell)
|
||||
{
|
||||
extern int term_width;
|
||||
int trim_size;
|
||||
|
||||
if(mfshell == NULL) return -1;
|
||||
|
||||
if(mfshell->local_working_dir == NULL)
|
||||
{
|
||||
mfshell->local_working_dir = (char*)calloc(PATH_MAX + 1,sizeof(char));
|
||||
getcwd(mfshell->local_working_dir,PATH_MAX);
|
||||
}
|
||||
|
||||
trim_size = term_width - 1;
|
||||
|
||||
printf("%-*.*s\n\r",
|
||||
trim_size,trim_size,
|
||||
mfshell->local_working_dir);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user