Changeset 612 for trunk/user
- Timestamp:
- Jan 11, 2019, 6:35:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/user/ksh/ksh.c
r611 r612 758 758 DIR * dir; 759 759 760 if (argc !=2 )760 if (argc > 2 ) 761 761 { 762 762 printf(" usage: ls [path]\n"); … … 764 764 else 765 765 { 766 767 // handle case with no argument 768 // TODO if ( argc == 1 ) path = "."; 766 // handle case with no argument 769 767 770 768 // get target directory path 771 pathname = argv[1]; 769 if ( argc == 1 ) strcpy( pathname , "." ); 770 else pathname = argv[1]; 772 771 773 772 // open target directory … … 788 787 while ( (entry = readdir(dir)) != NULL ) 789 788 { 790 printf(" -%s\n", entry->d_name);789 printf("%s\n", entry->d_name); 791 790 } 792 791
Note: See TracChangeset
for help on using the changeset viewer.