Skip to content

Commit 94585d9

Browse files
committed
minor refactor, tambah '/' di akhir ls kalo folder
1 parent 94e7636 commit 94585d9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/c/shell.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ int runShell() {
7272
} else if (strncmp("ln", argv[0], MAXIMUM_CMD_LEN) == 0) {
7373
if (argc != 3) {
7474
interrupt(0x21, 0,
75-
"Penggunaan: ln <path/sumber> <path/tujuan>\n",
76-
0, 0);
75+
"Penggunaan: ln <path/sumber> <path/tujuan>\n", 0, 0);
7776
} else {
7877
hardLink(cwdIdx, argv[1], argv[2]);
7978
}
@@ -92,8 +91,7 @@ int runShell() {
9291
} else if (strncmp("cp", argv[0], MAXIMUM_CMD_LEN) == 0) {
9392
if (argc != 3) {
9493
interrupt(0x21, 0,
95-
"Penggunaan: cp <path/sumber> <path/tujuan>\n",
96-
0, 0);
94+
"Penggunaan: cp <path/sumber> <path/tujuan>\n", 0, 0);
9795
} else {
9896
cp(cwdIdx, argv[1], argv[2]);
9997
}
@@ -217,6 +215,7 @@ void listDir(char parentIndex) {
217215
while (i < 1024) {
218216
if (*(dir + i) == parentIndex && *(dir + i + 2) != 0) {
219217
interrupt(0x21, 0, dir + i + 2, 0, 0);
218+
if (*(dir + i + 1) == '\xFF') interrupt(0x21, 0, "/", 0, 0);
220219
interrupt(0x21, 0, "\n", 0, 0);
221220
}
222221
i += 16;

0 commit comments

Comments
 (0)