~ubuntu-branches/ubuntu/lucid/mew-beta/lucid

« back to all changes in this revision

Viewing changes to bin/mewl.c

  • Committer: Bazaar Package Importer
  • Author(s): Tatsuya Kinoshita
  • Date: 2006-10-31 22:07:48 UTC
  • mfrom: (1.1.6 upstream) (2.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20061031220748-iq1bg528g9nt2l57
Tags: 5.1.52~0.20061031-1
New upstream release. (CVS trunk on 2006-10-31)

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
#include "mew.h"
11
11
 
12
 
private char version_message[] = "version 5.1 20060327 Kazu Yamamoto";
 
12
private char version_message[] = "version 5.2 20060727 Kazu Yamamoto";
13
13
 
14
14
#ifdef HAVE_UNISTD_H
15
15
# include <sys/types.h>
885
885
exec_getfile(char **filename, char **foldername)
886
886
{
887
887
        FILE *fp;
888
 
        char *p, *q;
 
888
        char *p, *q, *r;
889
889
        int c;
890
890
 
891
891
        *foldername = Current_folder;
910
910
                if (isdigit((unsigned char)*p) == 0) continue;
911
911
                *filename = p;
912
912
                while (isdigit((unsigned char)*p)) p++;
913
 
                if (STRCMP(p, Suffix)==0)
 
913
                if (STRCMP(p, Suffix)==0) {
 
914
                        r = p;
914
915
                        p = p + Suffix_len;
 
916
                } else
 
917
                        r = NULL;
915
918
                *p = NUL;
916
919
                fp = fopen(*filename, FDREAD);
917
 
                if (fp != NULL) return fp;
918
 
                /* incm? */
919
 
                if (strlen(*filename) + Suffix_len >= sizeof(Buf_filenm))
920
 
                        warn_exit("file name is too long.");
921
 
                strncat(p, Suffix, Suffix_len);
922
 
                fp = fopen(*filename, FDREAD);
923
 
                if (fp != NULL) return fp;
 
920
                if (fp != NULL) {
 
921
                        if (r != NULL) *r = NUL;
 
922
                        return fp;
 
923
                }
 
924
                if (r != NULL) {
 
925
                        *r = NUL;
 
926
                        fp = fopen(*filename, FDREAD);
 
927
                        if (fp != NULL) return fp;
 
928
                }
924
929
        }
925
930
        return NULL;
926
931
}