blob: 4cb872448bd8c5262313517fc2d2b0ab1402eb5e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include "abrtlib.h"
/* cuts the name from the NVR format: foo-1.2.3-1.el6
returns a newly allocated string
*/
char* get_package_name_from_NVR_or_NULL(const char* packageNVR)
{
char* package_name = NULL;
if (packageNVR != NULL)
{
VERB1 log("packageNVR %s", packageNVR);
package_name = xstrdup(packageNVR);
char *pos = strrchr(package_name, '-');
if (pos != NULL)
{
*pos = 0;
pos = strrchr(package_name, '-');
if (pos != NULL)
{
*pos = 0;
}
}
}
return package_name;
}
|