unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: Bug in ange-ftp parsing of ls output
Date: Thu, 20 Oct 2005 22:11:01 +0200	[thread overview]
Message-ID: <87sluwosoa.fsf@gmx.de> (raw)
In-Reply-To: <m31x2hbnvr.fsf@kfs-l.imdomain.dk> (Kim F. Storm's message of "Wed, 19 Oct 2005 16:08:24 +0200")

storm@cua.dk (Kim F. Storm) writes:

> I've digged out the following line from the response to an
> ls -al command:
>
> -rw-------    1 kfs             0 May 27  2003 .autorun.lck
>
> Now, if I position the cursor at the beginning of that line
> and enter
>
> M-: (ange-ftp-parse-filename) RET
>
> it returns:
>
> "27  2003 .autorun.lck"
>
> If I do
> M-: (re-search-forward ange-ftp-date-regexp nil t) RET
> at that position, point moves to the "M" in May.
>
> This is obviously wrong, but the ange-ftp-date-regexp is beyond me:
>
> "[0-9] \\(\\(\\([A-Za-z]\\|[^\0-\x7f]\\)\\([A-Za-z]\\|[^\0-\x7f]\\)+[.]?,? * [ 0-3][0-9][.]?\\|[ 0-3][0-9][.]? \\([A-Za-z]\\|[^\0-\x7f]\\)\\([A-Za-z]\\|[^\0-\x7f]\\)+[.]?,? *\\)\\|[ 0-1][0-9][^\0-\x7f] [ 0-3][0-9][.]?[^\0-\x7f]\\) "

This way the regexp is beyond me, too. Fortunately, it is well
documented in the ange-ftp.el sources.

The problem is that the line you've digged does not contain a group
id. That's why, "kfs 0" is regarded as a date.

> If I change the line to
>
> -rw-------    1 kfs            10 May 27  2003 .autorun.lck

Same problem. "kfs 10" is regarded as a date.

> it still fails, but this line works:
>
> -rw-------    1 kfs           100 May 27  2003 .autorun.lck

"kfs 100" is not a date because "100" exceeds the range of days :-)

> What's going on?

I've submitted a fix which should solve your problem. I cannot check
whether it breaks the syntax for Japanese dates - could somebody,
please, check it?

Best regards, Michael.

  reply	other threads:[~2005-10-20 20:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-19 14:08 Bug in ange-ftp parsing of ls output Kim F. Storm
2005-10-20 20:11 ` Michael Albinus [this message]
2005-10-21  3:08   ` Stefan Monnier
2005-10-21  5:49     ` Michael Albinus
2005-10-21  6:07       ` Stefan Monnier
2005-10-21 22:19       ` Richard M. Stallman
2005-10-23 12:37         ` Michael Albinus
2005-10-24  1:00           ` Richard M. Stallman
2005-10-25  6:07             ` Michael Albinus
2006-01-07  7:03         ` Daniel Brockman
2006-01-08 14:47           ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sluwosoa.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).