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) {
759759 return -ENOENT;
760760 }
761761
762- auto parentDir = parent->dynCast <Directory>();
763-
764- auto name = parentDir->locked ().getName (curr);
762+ auto name = parent->locked ().getName (curr);
765763 result = ' /' + name + result;
766- curr = parentDir ;
764+ curr = parent ;
767765 }
768766
769767 // Check if the cwd is the root directory.
770768 if (result.empty ()) {
771769 result = " /" ;
772770 }
773771
774- auto res = result.c_str ();
775- int len = strlen (res) + 1 ;
772+ int len = result.length () + 1 ;
776773
777774 // Check if the size argument is less than the length of the absolute
778775 // pathname of the working directory, including null terminator.
@@ -781,7 +778,7 @@ int __syscall_getcwd(intptr_t buf, size_t size) {
781778 }
782779
783780 // Return value is a null-terminated c string.
784- strcpy ((char *)buf, res );
781+ strcpy ((char *)buf, result. c_str () );
785782
786783 return len;
787784}
You can’t perform that action at this time.
0 commit comments