فهرست منبع

fixed list directory issue on path.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2200 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong@gmail.com 13 سال پیش
والد
کامیت
760f837871
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      examples/file/listdir.c

+ 1 - 1
examples/file/listdir.c

@@ -32,7 +32,7 @@ void list_dir(const char* path)
 			rt_memset(&s, 0, sizeof(struct stat));
 			rt_memset(&s, 0, sizeof(struct stat));
 
 
 			/* build full path for each file */
 			/* build full path for each file */
-			rt_sprintf(fullpath, "/%s", dirent->d_name);
+			rt_sprintf(fullpath, "%s/%s", path, dirent->d_name);
 
 
 			stat(fullpath, &s);
 			stat(fullpath, &s);
 			if ( s.st_mode & DFS_S_IFDIR )
 			if ( s.st_mode & DFS_S_IFDIR )