sumversion.c (762f99f4f3cb41a775b5157dd761217beba65873) | sumversion.c (9413e7640564fe70b24ea1a9ff3fb92c5bb52fcb) |
---|---|
1#include <netinet/in.h> 2#ifdef __sun__ 3#include <inttypes.h> 4#else 5#include <stdint.h> 6#endif 7#include <ctype.h> 8#include <errno.h> --- 373 unchanged lines hidden (view full) --- 382 free(dir); 383 free(cmd); 384 return ret; 385} 386 387/* Calc and record src checksum. */ 388void get_src_version(const char *modname, char sum[], unsigned sumlen) 389{ | 1#include <netinet/in.h> 2#ifdef __sun__ 3#include <inttypes.h> 4#else 5#include <stdint.h> 6#endif 7#include <ctype.h> 8#include <errno.h> --- 373 unchanged lines hidden (view full) --- 382 free(dir); 383 free(cmd); 384 return ret; 385} 386 387/* Calc and record src checksum. */ 388void get_src_version(const char *modname, char sum[], unsigned sumlen) 389{ |
390 char *buf, *pos, *firstline; | 390 char *buf; |
391 struct md4_ctx md; 392 char *fname; 393 char filelist[PATH_MAX + 1]; 394 395 /* objects for a module are listed in the first line of *.mod file. */ 396 snprintf(filelist, sizeof(filelist), "%s.mod", modname); 397 398 buf = read_text_file(filelist); 399 | 391 struct md4_ctx md; 392 char *fname; 393 char filelist[PATH_MAX + 1]; 394 395 /* objects for a module are listed in the first line of *.mod file. */ 396 snprintf(filelist, sizeof(filelist), "%s.mod", modname); 397 398 buf = read_text_file(filelist); 399 |
400 pos = buf; 401 firstline = get_line(&pos); 402 if (!firstline) { 403 warn("bad ending versions file for %s\n", modname); 404 goto free; 405 } 406 | |
407 md4_init(&md); | 400 md4_init(&md); |
408 while ((fname = strsep(&firstline, " "))) { | 401 while ((fname = strsep(&buf, " \n"))) { |
409 if (!*fname) 410 continue; 411 if (!(is_static_library(fname)) && 412 !parse_source_files(fname, &md)) 413 goto free; 414 } 415 416 md4_final_ascii(&md, sum, sumlen); 417free: 418 free(buf); 419} | 402 if (!*fname) 403 continue; 404 if (!(is_static_library(fname)) && 405 !parse_source_files(fname, &md)) 406 goto free; 407 } 408 409 md4_final_ascii(&md, sum, sumlen); 410free: 411 free(buf); 412} |