projects
/
GitHub
/
LineageOS
/
G12
/
android_hardware_amlogic_tools_dtbtool.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4b0ba1
)
Make tool robust to nonexistence of trailing slash at input path.
author
Wilhansen Li
<wil@byimplication.com>
Mon, 26 Dec 2016 13:19:46 +0000
(21:19 +0800)
committer
Wilhansen Li
<wil@byimplication.com>
Mon, 26 Dec 2016 13:19:46 +0000
(21:19 +0800)
dtbTool.c
patch
|
blob
|
blame
|
history
diff --git
a/dtbTool.c
b/dtbTool.c
index 665ef786a36a10b45a933b0ec4b8d4dd762e188f..38c2c0b281bf48b3e9a997c16d65cd4383c045e7 100644
(file)
--- a/
dtbTool.c
+++ b/
dtbTool.c
@@
-119,8
+119,18
@@
int parse_commandline(int argc, char *const argv[])
!= -1) {
switch (c) {
case 1:
- if (!input_dir)
+ if (!input_dir)
{
input_dir = optarg;
+ {
+ int len = strlen(input_dir);
+ if ( len > 0 && input_dir[len - 2] != '/' ) {
+ input_dir = malloc(len + 2);
+ strcpy(input_dir, optarg);
+ input_dir[len] = '/';
+ input_dir[len + 1] = 0;
+ }
+ }
+ }
break;
case 'o':
output_file = optarg;