Changeset 1433ecda in mainline for uspace/app/bdsh/cmds/modules/ls/ls.c
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/ls/ls.c
r47b2d7e3 r1433ecda 216 216 217 217 out: 218 for (i = 0; i < nbdirs; i++)218 for (i = 0; i < nbdirs; i++) 219 219 free(tosort[i].name); 220 220 free(tosort); … … 240 240 struct dir_elem_t *dir_list; 241 241 242 const char * 242 const char *const trailing_slash = "/"; 243 243 244 244 nbdirs = 0; … … 264 264 if (str_size(subdir_path) + str_size(path) + 1 <= PATH_MAX) 265 265 str_append(subdir_path, PATH_MAX, path); 266 if (path[str_size(path) -1] != '/' &&266 if (path[str_size(path) - 1] != '/' && 267 267 str_size(subdir_path) + str_size(trailing_slash) + 1 <= PATH_MAX) 268 268 str_append(subdir_path, PATH_MAX, trailing_slash); … … 328 328 help_cmd_ls(HELP_SHORT); 329 329 printf( 330 "Usage: %s [options] [path]\n"331 "If not path is given, the current working directory is used.\n"332 "Options:\n"333 " -h, --help A short option summary\n"334 " -u, --unsort Do not sort directory entries\n"335 " -r, --recursive List subdirectories recursively\n",336 cmdname);330 "Usage: %s [options] [path]\n" 331 "If not path is given, the current working directory is used.\n" 332 "Options:\n" 333 " -h, --help A short option summary\n" 334 " -u, --unsort Do not sort directory entries\n" 335 " -r, --recursive List subdirectories recursively\n", 336 cmdname); 337 337 } 338 338
Note:
See TracChangeset
for help on using the changeset viewer.