Commit 0961cf488d13f3696305a3355e02e4b7b7adb6d9
aqpkg: fix compile error due to const-incorrectness
| |   |
| 116 | 116 | exit(1); |
| 117 | 117 | } |
| 118 | 118 | |
| const char *parseversion(struct versionrevision *rversion, const char *string) |
| const char *parseversion(struct versionrevision *rversion, const char *str) |
| 120 | 120 | { |
| char *hyphen, *colon, *eepochcolon; |
| char *hyphen, *colon, *eepochcolon, *string; |
| 122 | 122 | unsigned long epoch; |
| 123 | 123 | |
| if ( !*string ) |
| if ( !*str ) |
| 125 | 125 | return QObject::tr( "Version string is empty." ); |
| 126 | 126 | |
| string = strdup(str); |
| 127 | 128 | colon= strchr(string,':'); |
| 128 | 129 | if (colon) { |
| 129 | 130 | epoch= strtoul(string,&eepochcolon,10); |
| if ( colon != eepochcolon ) |
| if ( colon != eepochcolon ) { |
| free(string); |
| 131 | 133 | return QObject::tr( "Epoch in version is not number." ); |
| if ( !*++colon ) |
| } |
| if ( !*++colon ) { |
| free(string); |
| 133 | 137 | return QObject::tr( "Nothing after colon in version number." ); |
| } |
| 134 | 139 | string= colon; |
| 135 | 140 | rversion->epoch= epoch; |
| 136 | 141 | } else { |
| … | … | |
| 167 | 167 | rversion->revision, |
| 168 | 168 | rversion->familiar_revision); |
| 169 | 169 | */ |
| free(string); |
| 170 | 171 | return 0; |
| 171 | 172 | } |
| 172 | 173 | |