mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0 KiB

  1. --- ./readdb.c (revision 53)
  2. +++ ./readdb.c (working copy)
  3. @@ -115,7 +115,7 @@
  4. struct dependency *dep;
  5. char line[1024], *t;
  6. char filename[PATH_MAX];
  7. - int line_length;
  8. + int line_length, i;
  9. FILE *f = dbf;
  10. if ( !dbf ) {
  11. @@ -151,8 +151,15 @@
  12. if ( line[line_length-1] == '\n' ) line[--line_length] = 0;
  13. if ( !strncmp(line, "[V] ", 4) ) {
  14. +#ifdef ROCK20
  15. p->version = malloc(line_length-3);
  16. sscanf(line+4, "%s", p->version);
  17. +#else
  18. + p->version = strdup(line+4);
  19. + for (i=0; p->version[i]; i++)
  20. + if (p->version[i] == ' ')
  21. + p->version[i] = '-';
  22. +#endif
  23. continue;
  24. }
  25. @@ -217,8 +224,15 @@
  26. line[--line_length] = 0;
  27. if ( !strncmp(line, "[V] ", 4) ) {
  28. +#ifdef ROCK20
  29. p->installed_version = malloc(line_length-3);
  30. - strcpy(p->installed_version, line+4);
  31. + sscanf(line+4, "%s", p->installed_version);
  32. +#else
  33. + p->installed_version = strdup(line+4);
  34. + for (i=0; p->installed_version[i]; i++)
  35. + if (p->installed_version[i] == ' ')
  36. + p->installed_version[i] = '-';
  37. +#endif
  38. continue;
  39. }
  40. }