opesys.c (goaccess-1.7) | : | opesys.c (goaccess-1.7.1) | ||
---|---|---|---|---|
/** | /** | |||
* opesys.c -- functions for dealing with operating systems | * opesys.c -- functions for dealing with operating systems | |||
* ______ ___ | * ______ ___ | |||
* / ____/___ / | _____________ __________ | * / ____/___ / | _____________ __________ | |||
* / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ | * / / __/ __ \/ /| |/ ___/ ___/ _ \/ ___/ ___/ | |||
* / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) | * / /_/ / /_/ / ___ / /__/ /__/ __(__ |__ ) | |||
* \____/\____/_/ |_\___/\___/\___/____/____/ | * \____/\____/_/ |_\___/\___/\___/____/____/ | |||
* | * | |||
* The MIT License (MIT) | * The MIT License (MIT) | |||
* Copyright (c) 2009-2022 Gerardo Orellana <hello @ goaccess.io> | * Copyright (c) 2009-2023 Gerardo Orellana <hello @ goaccess.io> | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining a copy | * Permission is hereby granted, free of charge, to any person obtaining a copy | |||
* of this software and associated documentation files (the "Software"), to deal | * of this software and associated documentation files (the "Software"), to deal | |||
* in the Software without restriction, including without limitation the rights | * in the Software without restriction, including without limitation the rights | |||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
* copies of the Software, and to permit persons to whom the Software is | * copies of the Software, and to permit persons to whom the Software is | |||
* furnished to do so, subject to the following conditions: | * furnished to do so, subject to the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be included in al l | * The above copyright notice and this permission notice shall be included in al l | |||
* copies or substantial portions of the Software. | * copies or substantial portions of the Software. | |||
skipping to change at line 414 | skipping to change at line 414 | |||
size_t i; | size_t i; | |||
if (str == NULL || *str == '\0') | if (str == NULL || *str == '\0') | |||
return NULL; | return NULL; | |||
str = char_replace (str, '+', ' '); | str = char_replace (str, '+', ' '); | |||
for (i = 0; i < ARRAY_SIZE (os); i++) { | for (i = 0; i < ARRAY_SIZE (os); i++) { | |||
if ((a = strstr (str, os[i][0])) != NULL) | if ((a = strstr (str, os[i][0])) != NULL) | |||
return parse_os (str, a, os_type, i); | return parse_os (str, a, os_type, i); | |||
} | } | |||
xstrncpy (os_type, "Unknown", OPESYS_TYPE_LEN); | ||||
if (conf.unknowns_as_crawlers && strcmp (os_type, "Crawlers")) | ||||
xstrncpy (os_type, "Crawlers", OPESYS_TYPE_LEN); | ||||
else | ||||
xstrncpy (os_type, "Unknown", OPESYS_TYPE_LEN); | ||||
if (conf.unknowns_log) | if (conf.unknowns_log) | |||
LOG_UNKNOWNS (("%-7s%s\n", "[OS]", str)); | LOG_UNKNOWNS (("%-7s%s\n", "[OS]", str)); | |||
return alloc_string ("Unknown"); | return alloc_string ("Unknown"); | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 6 lines changed or added |