use gnu indent to enforce coding style and adapt source

- indent options are listed in ./.indent.pro
 - use test case to run indent
This commit is contained in:
josch
2014-09-20 10:59:54 +02:00
parent d8e00119b4
commit 097a855751
43 changed files with 1325 additions and 1278 deletions

View File

@@ -17,34 +17,31 @@
*
*/
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "../mfshell.h"
#include "../commands.h" // IWYU pragma: keep
#include "../commands.h" // IWYU pragma: keep
int
mfshell_cmd_lpwd(mfshell *mfshell, int argc, char **argv)
int mfshell_cmd_lpwd(mfshell * mfshell, int argc, char **argv)
{
(void)argv;
if(mfshell == NULL) return -1;
if (mfshell == NULL)
return -1;
if (argc != 1) {
fprintf(stderr, "Invalid number of argumens\n");
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);
if (mfshell->local_working_dir == NULL) {
mfshell->local_working_dir = (char *)calloc(PATH_MAX + 1, sizeof(char));
getcwd(mfshell->local_working_dir, PATH_MAX);
}
printf("%s\n\r", mfshell->local_working_dir);
return 0;
}