2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002-2010 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Timothy Manning <timothy@yaffs.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
17 void join_paths(char *path1,char *path2,char *new_path )
20 //strcat(new_path,path1); /*since all functions have this then pull it out*/
21 if ( (path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]!='/') {
22 /*paths are compatiable. concatanate them. note -2 is because of \0*/
23 strcat(new_path,path1);
24 strcat(new_path,path2);
25 //char new_path[(sizeof(path1)/sizeof(char))+(sizeof(path2)/sizeof(char))];
26 //strcpy(new_path,strcat(path1,path2));
28 } else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]=='/') {
29 /*paths are compatiable. concatanate them*/
30 strcat(new_path,path1);
31 strcat(new_path,path2);
33 } else if ((path1[(sizeof(path1)/sizeof(char))-2]!='/') && path2[0]!='/') {
34 /*need to add a "/". */
35 strcat(new_path,path1);
37 strcat(new_path,path2);
39 } else if ((path1[(sizeof(path1)/sizeof(char))-2]=='/') && path2[0]=='/') {
40 /*need to remove a "/". */
41 /*yaffs does not mind the extra slash. */
42 strcat(new_path,path1);
43 strcat(new_path,path2);
51 void print_message(char *message,char print_level)
53 if (print_level <= PRINT_LEVEL){