Re: [PATCH] dired mg patch
This is a slightly modified diff from Henri's latest one. It fixes the issue that if a filename has a space at the start of it, the point will stay in the first character column and not jump to the first non ' ' character in the filename. However, it does seem to expose a bug in dired, that if a filename has a space at the start of it, mg doesn't find it if you try and open it. mg gives a message of (New File) and creates and empty buffer. But in the mean time, I think this change does make this diff more correct. -lum Index: dired.c === RCS file: /cvs/src/usr.bin/mg/dired.c,v retrieving revision 1.48 diff -u -p -r1.48 dired.c --- dired.c 23 Jan 2011 00:45:03 - 1.48 +++ dired.c 29 Aug 2011 04:06:16 - @@ -36,6 +36,11 @@ static intd_rename(int, int); static int d_shell_command(int, int); static int d_create_directory(int, int); static int d_makename(struct line *, char *, size_t); +static int d_warpdot(struct line *, int *); +static int d_forwpage(int, int); +static int d_backpage(int, int); +static int d_forwline(int, int); +static int d_backline(int, int); static void reaper(int); extern struct keymap_s helpmap, cXmap, metamap; @@ -57,15 +62,15 @@ static PF dirednul[] = { static PF diredcl[] = { reposition, /* ^L */ d_findfile, /* ^M */ - forwline, /* ^N */ + d_forwline, /* ^N */ rescan, /* ^O */ - backline, /* ^P */ + d_backline, /* ^P */ rescan, /* ^Q */ backisearch,/* ^R */ forwisearch,/* ^S */ rescan, /* ^T */ universal_argument, /* ^U */ - forwpage, /* ^V */ + d_forwpage, /* ^V */ rescan, /* ^W */ NULL/* ^X */ }; @@ -77,7 +82,7 @@ static PF diredcz[] = { rescan, /* ^] */ rescan, /* ^^ */ rescan, /* ^_ */ - forwline, /* SP */ + d_forwline, /* SP */ d_shell_command,/* ! */ rescan, /* " */ rescan, /* # */ @@ -99,9 +104,9 @@ static PF diredc[] = { }; static PF diredn[] = { - forwline, /* n */ + d_forwline, /* n */ d_ffotherwindow,/* o */ - backline, /* p */ + d_backline, /* p */ rescan, /* q */ d_rename, /* r */ rescan, /* s */ @@ -116,13 +121,32 @@ static PF direddl[] = { d_undelbak /* del */ }; +static PF diredbp[] = { + d_backpage /* v */ +}; + +static PF dirednull[] = { + NULL +}; + #ifndefDIRED_XMAPS #defineNDIRED_XMAPS0 /* number of extra map sections */ #endif /* DIRED_XMAPS */ -static struct KEYMAPE (6 + NDIRED_XMAPS + IMAPEXT) diredmap = { - 6 + NDIRED_XMAPS, - 6 + NDIRED_XMAPS + IMAPEXT, +static struct KEYMAPE (1 + IMAPEXT) d_backpagemap = { + 1, + 1 + IMAPEXT, + rescan, + { + { + 'v', 'v', diredbp, NULL + } + } +}; + +static struct KEYMAPE (7 + NDIRED_XMAPS + IMAPEXT) diredmap = { + 7 + NDIRED_XMAPS, + 7 + NDIRED_XMAPS + IMAPEXT, rescan, { #ifndef NO_HELP @@ -138,6 +162,10 @@ static struct KEYMAPE (6 + NDIRED_XMAPS CCHR('L'), CCHR('X'), diredcl, (KEYMAP *) & cXmap }, { + CCHR('['), CCHR('['), dirednull, (KEYMAP *) & + d_backpagemap + }, + { CCHR('Z'), '+', diredcz, (KEYMAP *) & metamap }, { @@ -165,8 +193,12 @@ dired_init(void) funmap_add(d_findfile, "dired-find-file"); funmap_add(d_ffotherwindow, "dired-find-file-other-window"); funmap_add(d_del, "dired-flag-file-deleted"); + funmap_add(d_forwline, "dired-next-line"); funmap_add(d_otherwindow, "dired-other-window"); + funmap_add(d_backline, "dired-previous-line"); funmap_add(d_rename, "dired-rename-file"); + funmap_add(d_backpage, "dired-scroll-down"); + funmap_add(d_forwpage, "dired-scroll-up"); funmap_add(d_undel, "dired-unflag"); maps_add((KEYMAP *)&diredmap, "dired"); dobindkey(fundamental_map, "dired", "^Xd"); @@ -592,6 +624,58 @@ d_makename(struct line *lp, char *fn, si return ((lgetc(lp, 2) == 'd') ? TRUE : FALSE); } +static int +d_warpdot(struct line *dotp, int *doto) +{ + char *tp = dotp->l_text; + int off = 0, field = 0, len; + +
Promo Camaras de Seguridad
Camaras De SeguridadPROMO!! eAraS.jpg 4 Camaras + DVR + 4 Fuentes + Disco Rmgido + 4 Balunes + Instalacisn A Solo $3550.- (+ IVA 10,5) < /DIV> Controle su casa o negocio por internet Especialmente orientado a empresas * 4 Camaras ITP 204 CCD 1/4" Sharp. Color. Infrarroja 24 Leds (Hasta 25 m). Exterior. * 1 DVR Semiprofesional AVR 400 Entradas 4 de video 2 de audio. Salida VG y Video, Ethernet, Mouse, RS485 y alarmas. Zoom Digital. Soporta celulares. * 4 Pares de Balunes Video alimentacisn. * 4 Fuentes de Alimentacisn Switching 12Vcc 1A Regulada Enchufable * 1 Disco Rmgido de 500 Gb. * Cable UTP Categorma 5 $1,70 y $2,20 el metro. Mail: ventas.dahesolucio...@gmail.com Tel: 4842-4488 - 9 a 13 hs.Tel: 15-3123-5376 - 9 a 17 hs.Tel: 15-3802-4129- 9 a 17 hs. http://www.dahesoluciones.com.ar (Instalaciones solo en GBA y Capital, al interior envios con el kit pre-armado)
Re: cc thread model single/posix?
> Does anybody remember why gcc3 is configured with thread model > "single" and gcc4 with thread model "posix" on our platforms and > what the difference is? According to the commit message when kurt@ switched gcc3 to the posix thread model, it ``makes dwarf2 exception handling thread safe and enables thread safety for libstdc++''. That change was reverted because it did not work correctly on hppa. Now that hppa has switched to gcc4, there is no reason not to bring this change back in. Miod
Re: [PATCH] dired mg patch
> > > The warpdot() has at least one issue. It leads to > > > segfaults if you try to open a directory like (BCD). > > > > [.. diff ..] > > > ed > > > > > > mg doesn't segfault. > > > > Your fix is wrong, and only works by chance. If you craft > > a directory with enough spaces in its name, it'll segfault > > again. And you cannot fix this in warpdot, it's the wrong > > place. The bug is in dired_(), which should abort if the > > command fails. > > > The proper fix is to escape shell metacharacters. That is one (ugly, if you will) way to fix the problem that makes it impossible to open files with funny names. That, however, does not fix the segfaults, because if sh or ls fail for any reason, you'll again adjust the dot offset based on the char array which does not reflect reality. The metacharacter issue is also a bug not related to the warpping we're doing, and is probably best fixed in a separate diff. > There's already strspn(), why write your own > substitute for warpdot() ? Because llength() is the correct way to determine where a line ends in mg. Notably, lines may embed NUL bytes, and they're not required to terminate with one. Checking the length also makes sure you don't try to read an empty line (which may or may be a NULL pointer, I don't care). > You're also returning by supplying the function inside. > This makes the code less readable. I'm just returning (TRUE) because the function can never fail. You could also decide that it's appropriate to return (FALSE) if the 9th field cannot be located, but this doesn't change how the assignment should be done. The actual processing is done through pointers on the stack because we cannot do it via the global pointer (curwp), for the reasons I outlined in my previous message. > Lastly, the changes you made in dired_() seem > overcomplicated to me. If you prefer interleaving unrelated operations, be my guest. After all, it's not my choice. I just hope I needn't touch such code. > You're iterating twice for lforw() and d_warpdot(). If I wasn't already sick of this thread, I'd ask you to quote the exact lines of code to show where I'm iterating twice. Because I don't see it. > In the while() loop, we can already locate the .. and > we just need to lforw() there using the warp variable. > This seems redundant to me. Yes, we could, and I explained why I changed that (which is 1: giving warpdot only a pointer to char array is wrong, and 2: the code was interleaved with other things, namely the reading of ls output, and the closing of the pipe). There's a third reason, which is the misuse of strrchr to extract the filename. So I cleaned up the problematic bunch and fixed the segfault. > > > Your warpdot() works differently > > > and doesn't quite conform to style. You're assigning > > > a value to a variable without checking if this is correct > > > or not. This style is hard to read according to me. > > > > Bullshit. It's not a matter of style; it's a question > > It's a matter of style. The way you're designing the loops > and the functions look needlessly complicated to me, and > it's a bit hard to follow. God. Should forwchar() also return a dot offset and line pointer and let the caller assign them and decide how to handle the exception when they point out of bounds? What if this is a showstopper -- should the caller then return these two values on top of its own return value, and let the caller of the caller decide what to do? We might as propagate all errors to main(). Do you want that 20k line diff? > > of whether or not an error can happen, and what to do when > > it happens. In this case, if there was an error to handle, > > we could return zero, which will always be a legal value (since > > we are assigning to an int which is zero if the line is empty). > > Warpdot() is meant to find the 9th column, if it can't, then something's > wrong. It should return -1 to indicate failure. To be safe, doto > should be set to 0. See above.
cc thread model single/posix?
Does anybody remember why gcc3 is configured with thread model "single" and gcc4 with thread model "posix" on our platforms and what the difference is? -- Christian "naddy" Weisgerber na...@mips.inka.de
Fix for UDMA with ServerWorks IDE controller
When the ServerWorks IDE controller was added to pciide(4) the serverworks_chip_map() was missed being updated to set the UDMA capability field for the controller as appropriate so at the moment all devices connected to said controllers will only use UDMA mode 0 instead of whatever they're actually capable of such as mode 2 for a CD/DVD-rom drive for example. pciide1 at pci0 dev 2 function 1 "ServerWorks HT-1000 IDE" rev 0x00: DMA atapiscsi0 at pciide1 channel 0 drive 0 scsibus0 at atapiscsi0: 2 targets cd0 at scsibus0 targ 0 lun 0: ATAPI 5/cdrom removable cd0(pciide1:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 0 ^^^ So if you have a system with said controller and can actually test the CD/DVD-rom drive which is typically connected to this controller (or HDs if possible too) then please test this. Index: pciide.c === RCS file: /home/cvs/src/sys/dev/pci/pciide.c,v retrieving revision 1.332 diff -u -p -r1.332 pciide.c --- pciide.c15 Jul 2011 16:44:18 - 1.332 +++ pciide.c17 Jul 2011 03:50:52 - @@ -7427,6 +7425,7 @@ serverworks_chip_map(struct pciide_softc sc->sc_wdcdev.UDMA_cap = 4; break; case PCI_PRODUCT_RCC_CSB6_RAID_IDE: + case PCI_PRODUCT_RCC_HT_1000_IDE: sc->sc_wdcdev.UDMA_cap = 5; break; } -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Re: [PATCH] dired mg patch
On Sat, Aug 27, 2011 at 08:51:08PM +0300, Henri Kemppainen wrote: > > The warpdot() has at least one issue. It leads to > > segfaults if you try to open a directory like (BCD). > > [.. diff ..] > > ed > > > > mg doesn't segfault. > > Your fix is wrong, and only works by chance. If you craft > a directory with enough spaces in its name, it'll segfault > again. And you cannot fix this in warpdot, it's the wrong > place. The bug is in dired_(), which should abort if the > command fails. > The proper fix is to escape shell metacharacters. This diff works with all kind of crazy filenames like. XXX(){}[]'"\;<>|?!$^&~LOL ((()) (!^&*~" I've looked at the latest diff you've posted on tech@. The funmap() keybindings are relevant. There's already strspn(), why write your own substitute for warpdot() ? You're also returning by supplying the function inside. This makes the code less readable. Lastly, the changes you made in dired_() seem overcomplicated to me. You're iterating twice for lforw() and d_warpdot(). In the while() loop, we can already locate the .. and we just need to lforw() there using the warp variable. This seems redundant to me. Here's the diff + my fix for the PR opened by Nima. Index: src/usr.bin/mg/dired.c === RCS file: /cvs/src/usr.bin/mg/dired.c,v retrieving revision 1.48 diff -u -p -r1.48 dired.c --- src/usr.bin/mg/dired.c 23 Jan 2011 00:45:03 - 1.48 +++ src/usr.bin/mg/dired.c 28 Aug 2011 11:00:05 - @@ -36,6 +36,11 @@ static intd_rename(int, int); static int d_shell_command(int, int); static int d_create_directory(int, int); static int d_makename(struct line *, char *, size_t); +static int d_warpdot(char *); +static int d_forwpage(int, int); +static int d_backpage(int, int); +static int d_forwline(int, int); +static int d_backline(int, int); static void reaper(int); extern struct keymap_s helpmap, cXmap, metamap; @@ -57,15 +62,15 @@ static PF dirednul[] = { static PF diredcl[] = { reposition, /* ^L */ d_findfile, /* ^M */ - forwline, /* ^N */ + d_forwline, /* ^N */ rescan, /* ^O */ - backline, /* ^P */ + d_backline, /* ^P */ rescan, /* ^Q */ backisearch,/* ^R */ forwisearch,/* ^S */ rescan, /* ^T */ universal_argument, /* ^U */ - forwpage, /* ^V */ + d_forwpage, /* ^V */ rescan, /* ^W */ NULL/* ^X */ }; @@ -77,7 +82,7 @@ static PF diredcz[] = { rescan, /* ^] */ rescan, /* ^^ */ rescan, /* ^_ */ - forwline, /* SP */ + d_forwline, /* SP */ d_shell_command,/* ! */ rescan, /* " */ rescan, /* # */ @@ -99,9 +104,9 @@ static PF diredc[] = { }; static PF diredn[] = { - forwline, /* n */ + d_forwline, /* n */ d_ffotherwindow,/* o */ - backline, /* p */ + d_backline, /* p */ rescan, /* q */ d_rename, /* r */ rescan, /* s */ @@ -116,13 +121,32 @@ static PF direddl[] = { d_undelbak /* del */ }; +static PF diredbp[] = { + d_backpage /* v */ +}; + +static PF dirednull[] = { + NULL +}; + #ifndefDIRED_XMAPS #defineNDIRED_XMAPS0 /* number of extra map sections */ #endif /* DIRED_XMAPS */ -static struct KEYMAPE (6 + NDIRED_XMAPS + IMAPEXT) diredmap = { - 6 + NDIRED_XMAPS, - 6 + NDIRED_XMAPS + IMAPEXT, +static struct KEYMAPE (1 + IMAPEXT) d_backpagemap = { + 1, + 1 + IMAPEXT, + rescan, + { + { + 'v', 'v', diredbp, NULL + } + } +}; + +static struct KEYMAPE (7 + NDIRED_XMAPS + IMAPEXT) diredmap = { + 7 + NDIRED_XMAPS, + 7 + NDIRED_XMAPS + IMAPEXT, rescan, { #ifndef NO_HELP @@ -138,6 +162,10 @@ static struct KEYMAPE (6 + NDIRED_XMAPS CCHR('L'), CCHR('X'), diredcl, (KEYMAP *) & cXmap }, { + CCHR('['), CCHR('['), dirednull, (KEYMAP *) & + d_backpagemap + }, + { CCHR('Z'), '+', diredcz, (KEYMAP *) & metamap }, { @@ -165,8 +193,12 @@ dired_init(void) funmap_add(d_findfile, "dired-find-file"); funmap_add(d_ffotherwindow, "dired-find-file-other-window"); funmap_add(d_del, "
Curso interactivo Office 2010 Windows 7
CURSO MULTIMEDIA DE WINDOWS 7 Y OFFICE 2010 En un DVD interactivo para PC (requisito :tener lectora de DVD en la PC) Para realizar en su casa sin necesidad de asistir a cursos ni seminarios. Incluye Csmo instalar el sistema operativo Consejos basicos para su configuracisn y mantenimiento Como utilizar windows 7 para niqos, adultos y tercera edad. Como mejorar las tareas con Windows 7 La gestisn de la barra de tareas Maximo aprovechamiento de programas como Paint Como instalar de una red inalambrica en el hogar Csmo mejorar el rendimiento de la PC y aprovechar al maximo sus caractermsticas Recursos para mejorar la seguridad y proteccisn de la maquina Windows Live Essentials Gestisn de archivos audiovisuales Reproduccisn de mzsica y vmdeo Juegos de aprendizaje y entretenimiento El navegador Internet Explorer 8 para un mayor disfrute de la Red Conocimiento de las redes sociales Windows mobile 6.1 .Integracisn de correo, agenda y tareas:acceder a internet a travis de tu telifono msvil Innovaciones de MS Office 2010 Word 2010: Compartir documentos y trabajar en equipo ,mejorar el impacto de los documentos,crear documentos de aspecto mas profesional. Excel 2010: Como aumentar el rendimiento.Las principales novedades.Practica interactiva:.Excel Web App.Documentos desde distintas ubicaciones .Mejorar la presentacisn de datos. Power Point 2010: vmdeos y efectos fotograficos.Transformar imagenes en elementos artmsticos .efectos de fotografma a las presentaciones.Aumentar el poder de las presentaciones.Los nuevos diagramas y organigramas.La nueva utilidad Backstage Outlook 2010 Csmo mejorar la gestisn del correo electrsnico.mejorar las tareas y conectarse a las redes sociales El nuevo OneNote 2010-Kit de recursos de Microsoft y practicas de Windows 7 y Office 2010 Y muchos trucos y consejos para obtener el mejor beneficio de sus programas y su PC Solicite ya el CURSO MULTIMEDIA DE WINDOWS 7 Y OFFICE 2010 a officu...@hotmail.com por $ 150 indicando nombre direccisn, localidad y csdigo postal. Envios sin cargo por Correo Argentino contra reembolso. Envmos a Capital por mensajeria (indicando el horario de su preferencia)