Re: [BUG] Segmentation fault when copy symlink with checked Stable Symlinks
Hi Jindrich, On Tue, 2005-09-13 at 13:07 +0200, Jindrich Novy wrote: - my_second = resolve_symlinks (second); - if (my_second == NULL) { - g_free (my_first); + if (my_second == NULL) return buf; - } Why do you drop the g_free of my_first here? By the way, this patch is a bit sloppy wrt whitespace. And could you please add a change log entry? Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [BUG] Segmentation fault when copy symlink with checked Stable Symlinks
Hi Jindrich, On Tue, 2005-09-13 at 13:07 +0200, Jindrich Novy wrote: The attached patch fixes two nasty bugs in file.c and util.c. Could you please supply fixes for different issues in different patches? Thanks. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [BUG] Segmentation fault when copy symlink with checked Stable Symlinks
Hi, On Sat, 2005-09-17 at 12:48 +0200, Leonard den Ottolander wrote: Hi Jindrich, On Tue, 2005-09-13 at 13:07 +0200, Jindrich Novy wrote: - my_second = resolve_symlinks (second); - if (my_second == NULL) { - g_free (my_first); + if (my_second == NULL) return buf; - } Why do you drop the g_free of my_first here? It seems like the whole if (j) block is redundant. Right? Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [BUG] Segmentation fault when copy symlink with checked Stable Symlinks
Hi Jindrich, On Tue, 2005-09-13 at 13:07 +0200, Jindrich Novy wrote: The attached patch fixes two nasty bugs in file.c and util.c. Split in two, cleaned up, and committed both. Thanks. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [BUG] Segmentation fault when copy symlink with checked Stable Symlinks
Hi Leonard, On Sat, 2005-09-17 at 12:59 +0200, Leonard den Ottolander wrote: Hi, On Sat, 2005-09-17 at 12:48 +0200, Leonard den Ottolander wrote: Hi Jindrich, On Tue, 2005-09-13 at 13:07 +0200, Jindrich Novy wrote: - my_second = resolve_symlinks (second); - if (my_second == NULL) { - g_free (my_first); + if (my_second == NULL) return buf; - } Why do you drop the g_free of my_first here? It seems like the whole if (j) block is redundant. Right? Yeah, the whole if (j) part is pretty bogus and can be removed. Apparently there's no leakage of my_first because the if (my_second == NULL) in the if (j) condition never succeed as it's checked already before the loop. So we can remove it safely. Thanks for the review. The changelog entries and separate patches are comming up. 2005-09-17 Jindrich Novy [EMAIL PROTECTED] * util.c: Fixed segfault in diff_two_paths() when symlink is copied with Stable Symlinks checked. * file.c: Fixed off-by-one indexing error in make_symlink() causing generation of dangled symlinks. Cheers, Jindrich -- Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/ (o_ _o) //\ The worst evil in the world is refusal to think. //\ V_/_ _\_V --- mc-4.6.1/src/util.c.jn 2005-05-27 16:19:18.0 +0200 +++ mc-4.6.1/src/util.c 2005-09-17 13:58:47.0 +0200 @@ -1140,22 +1140,20 @@ * as needed up in first and then goes down using second */ char *diff_two_paths (const char *first, const char *second) { -char *p, *q, *r, *s, *buf = 0; +char *p, *q, *r, *s, *buf = NULL; int i, j, prevlen = -1, currlen; char *my_first = NULL, *my_second = NULL; my_first = resolve_symlinks (first); if (my_first == NULL) return NULL; +my_second = resolve_symlinks (second); +if (my_second == NULL) { + g_free (my_first); + return NULL; +} for (j = 0; j 2; j++) { p = my_first; - if (j) { - my_second = resolve_symlinks (second); - if (my_second == NULL) { - g_free (my_first); - return buf; - } - } q = my_second; for (;;) { r = strchr (p, PATH_SEP); --- mc-4.6.1/src/file.c.jn 2005-05-27 16:19:18.0 +0200 +++ mc-4.6.1/src/file.c 2005-09-17 13:58:20.0 +0200 @@ -382,7 +382,7 @@ const char *r = strrchr (src_path, PATH_SEP); if (r) { - p = g_strndup (src_path, r - src_path); + p = g_strndup (src_path, r - src_path + 1); if (*dst_path == PATH_SEP) q = g_strdup (dst_path); else ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] do_execute() flush stdout before executing a command
Hello Pavel, On Sat, 2005-08-27 at 21:46 +0300, Pavel Tsekov wrote: * execute.c (do_execute): Flush stdout after printing the command to be executed. Committed. Thanks. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] do_execute() flush stdout before executing a command
Hello, On Sat, 17 Sep 2005, Leonard den Ottolander wrote: Hello Pavel, On Sat, 2005-08-27 at 21:46 +0300, Pavel Tsekov wrote: * execute.c (do_execute): Flush stdout after printing the command to be executed. Committed. Thanks. Oh. Finally. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] do_execute() flush stdout before executing a command
Hi Pavel, On Sat, 2005-09-17 at 15:21 +0300, Pavel Tsekov wrote: On Sat, 17 Sep 2005, Leonard den Ottolander wrote: Committed. Thanks. Oh. Finally. LOL. You are so predictable. You forgot the thank you part ;-p . Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] do_execute() flush stdout before executing a command
Hello, On Sat, 17 Sep 2005, Leonard den Ottolander wrote: Hi Pavel, On Sat, 2005-09-17 at 15:21 +0300, Pavel Tsekov wrote: On Sat, 17 Sep 2005, Leonard den Ottolander wrote: Committed. Thanks. Oh. Finally. LOL. You are so predictable. Sure. So are you - I succesfully predicted that it will take ages to review this patch. You forgot the thank you part ;-p . I don't have to thank anyone. I find a bug and I post a patch . It is up to you to decide what to do with it. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] do_execute() flush stdout before executing a command
Hi Pavel, On Sat, 2005-09-17 at 16:31 +0300, Pavel Tsekov wrote: On Sat, 17 Sep 2005, Leonard den Ottolander wrote: On Sat, 2005-09-17 at 15:21 +0300, Pavel Tsekov wrote: On Sat, 17 Sep 2005, Leonard den Ottolander wrote: Committed. Thanks. Oh. Finally. In dutch we call this kind of response stank voor dank (stench for thanks). LOL. You are so predictable. Sure. So are you - I succesfully predicted that it will take ages to review this patch. You forgot the thank you part ;-p . I don't have to thank anyone. You are correct. The point is you do the opposite. No reaction would have been far more polite than your reaction. This is a repeating problem. You should take some lessons in courtesy. I find a bug and I post a patch . It is up to you to decide what to do with it. Right. And as I am under no obligation towards you, I do not understand why you complain things take a while. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] do_execute() flush stdout before executing a command
Hello, On Sat, 17 Sep 2005, Leonard den Ottolander wrote: Sure. So are you - I succesfully predicted that it will take ages to review this patch. You forgot the thank you part ;-p . I don't have to thank anyone. You are correct. The point is you do the opposite. No reaction would have been far more polite than your reaction. This is a repeating problem. You should take some lessons in courtesy. I don't think so. And this really has nothing to do with MC. I find a bug and I post a patch . It is up to you to decide what to do with it. Right. And as I am under no obligation towards you, I do not understand why you complain things take a while. No particular reason. I do not complain - I just observe and predict. It is strange that my predictions make you feel like I am complaining. And by the way I really have no reason to complain - while MC remains realtively buggy it becomes one of that best viewers around - isn't that great ? ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel