On 08.02.2012 15:04, Nikola Pajkovsky wrote:
+%{_bindir}/abrt-dedup-client
it would be nice to put dedup bin into .gitignore
done
diff --git a/src/plugins/abrt-dedup-client.c b/src/plugins/abrt-dedup-client.c new file mode 100644 index 0000000..cecc4d8 --- /dev/null +++ b/src/plugins/abrt-dedup-client.c +static inline int is_valid_component_name(const char *name) +{
- int i;
- unsigned char c;
- for (i = 0; name[i]; ++i)
- {
c = (unsigned char)name[i];
if ((c< 'a' || c> 'z')&&
(c< 'A' || c> 'Z')&&
(c< '0' || c> '9')&&
it's isalnum ^^
done
+static void escape(const char *src, struct strbuf *dest) +{
- int i;
- unsigned char c;
- for (i = 0; src[i]; ++i)
- {
c = (unsigned char)src[i];
if ((c>= 'a'&& c<= 'z') ||
(c>= 'A'&& c<= 'Z') ||
(c>= '0'&& c<= '9') ||
done
OPT_BOOL('k', "insecure", NULL,
_("allow insecure connection to dedup server")),
- if (!ssl_allow_insecure)
ssl_allow_insecure = opts& OPT_insecure;
ssl_allow_insecure is hardcoded to false, if is always true
it is read from environment few lines above
- if (!dump_dir_name)
dump_dir_name = strdup(".");
dump_dir_name is never NULL, because it's static variable defined at the beginning of source code
removed
- struct strbuf *request_body = strbuf_new();
- strbuf_append_str(request_body, "component=");
- /* escape component - may contain '+' */
- escape(component, request_body);
- free(component);
- strbuf_append_str(request_body, "&backtrace=");
- escape(backtrace, request_body);
when I'm thinking about the escape function it will be better to introduce two new *strbuf_append_escape_str[f] functions.
can be split whenever another program needs it
- /* iterate line by line */
- char *line = response_body, *newline = response_body;
- for (line = response_body; line; line = newline)
- {
twice association response_body to line variable
for ( ; line; line = newline)
or
char *newline = response_body; for (char *line; line; line = newline)
fixed