File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -759,20 +759,17 @@ int __syscall_getcwd(intptr_t buf, size_t size) {
759
759
return -ENOENT;
760
760
}
761
761
762
- auto parentDir = parent->dynCast <Directory>();
763
-
764
- auto name = parentDir->locked ().getName (curr);
762
+ auto name = parent->locked ().getName (curr);
765
763
result = ' /' + name + result;
766
- curr = parentDir ;
764
+ curr = parent ;
767
765
}
768
766
769
767
// Check if the cwd is the root directory.
770
768
if (result.empty ()) {
771
769
result = " /" ;
772
770
}
773
771
774
- auto res = result.c_str ();
775
- int len = strlen (res) + 1 ;
772
+ int len = result.length () + 1 ;
776
773
777
774
// Check if the size argument is less than the length of the absolute
778
775
// pathname of the working directory, including null terminator.
@@ -781,7 +778,7 @@ int __syscall_getcwd(intptr_t buf, size_t size) {
781
778
}
782
779
783
780
// Return value is a null-terminated c string.
784
- strcpy ((char *)buf, res );
781
+ strcpy ((char *)buf, result. c_str () );
785
782
786
783
return len;
787
784
}
You can’t perform that action at this time.
0 commit comments