← Commit list

baa89b398

Rob Landley
Rob Landley
2006-05-07
SOURCE BUG Duration: 71s

Subject

Patch to fix bug 868, and some related cleanup while I was in the area. A tab is now taken as the end of filename if it's there, but if it isn't (because the timestamp isn't there) we continue with the existing untruncated line as the filename.

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/patch.c+6 -18
@@ -54,29 +54,17 @@ static unsigned int copy_lines(FILE *src_stream, FILE *dest_stream, const unsign
static char *extract_filename(char *line, int patch_level)
{
- char *filename_start_ptr = line + 4;
+ char *temp, *filename_start_ptr = line + 4;
int i;
/* Terminate string at end of source filename */
- {
- char *line_ptr;
- line_ptr = strchr(filename_start_ptr, '\t');
- if (!line_ptr) {
- bb_perror_msg("Malformed line %s", line);
- return(NULL);
- }
- *line_ptr = '\0';
- }
+ temp = strchr(filename_start_ptr, '\t');
+ if (temp) *temp = 0;
- /* Skip over (patch_level) number of leading directories */
+ /* skip over (patch_level) number of leading directories */
for (i = 0; i < patch_level; i++) {
- char *dirname_ptr;
-
- dirname_ptr = strchr(filename_start_ptr, '/');
- if (!dirname_ptr) {
- break;
- }
- filename_start_ptr = dirname_ptr + 1;
+ if(!(temp = strchr(filename_start_ptr, '/'))) break;
+ filename_start_ptr = temp + 1;
}
return(bb_xstrdup(filename_start_ptr));