Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
summeros
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Byron Lathi
summeros
Commits
fd4d7595
Commit
fd4d7595
authored
3 years ago
by
Byron Lathi
Browse files
Options
Downloads
Patches
Plain Diff
use a copy of filename so it won't overwrite
parent
221a836e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/Devices/Storage/ext2.c
+10
-5
10 additions, 5 deletions
kernel/Devices/Storage/ext2.c
with
10 additions
and
5 deletions
kernel/Devices/Storage/ext2.c
+
10
−
5
View file @
fd4d7595
...
...
@@ -146,9 +146,14 @@ uint32_t ext2_parse_path_to_inode_num(int8_t* filename)
return
-
1
;
}
int8_t
_tmpfilename
[
128
];
int8_t
*
tmpfilename
=
_tmpfilename
;
//kind of a hack
strcpy
(
filename
,
tmpfilename
);
// ignore the first slash, since we know its there
filename
++
;
int8_t
*
end_pointer
=
filename
;
tmp
filename
++
;
int8_t
*
end_pointer
=
tmp
filename
;
int
more_to_do
=
1
;
...
...
@@ -172,10 +177,10 @@ uint32_t ext2_parse_path_to_inode_num(int8_t* filename)
// this will now find the first entry in the root directory
inode
=
ext2_find_inode_num2
(
filename
,
inode
);
inode
=
ext2_find_inode_num2
(
tmp
filename
,
inode
);
if
(
!
inode
)
{
printf
(
"File not found: %s
\n
"
,
filename
);
printf
(
"File not found: %s
\n
"
,
tmp
filename
);
return
inode
;
}
...
...
@@ -186,7 +191,7 @@ uint32_t ext2_parse_path_to_inode_num(int8_t* filename)
// might as well stop that even if they are out of scope soon
if
(
more_to_do
)
{
end_pointer
++
;
filename
=
end_pointer
;
tmp
filename
=
end_pointer
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment