diff options
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 30 | ||||
-rw-r--r-- | XMakefile | 5 | ||||
-rw-r--r-- | display.c | 4 | ||||
-rw-r--r-- | etc.c | 8 | ||||
-rw-r--r-- | file.c | 4 | ||||
-rw-r--r-- | func.c | 4 | ||||
-rw-r--r-- | history.c | 6 | ||||
-rw-r--r-- | indep.c | 6 | ||||
-rw-r--r-- | linein.c | 4 | ||||
-rw-r--r-- | local.c | 4 | ||||
-rw-r--r-- | main.c | 10 | ||||
-rw-r--r-- | parsetagx.c | 4 | ||||
-rw-r--r-- | terms.c | 4 | ||||
-rw-r--r-- | textlist.h | 4 | ||||
-rw-r--r-- | url.c | 22 | ||||
-rw-r--r-- | w3mhelperpanel.c | 4 |
16 files changed, 77 insertions, 46 deletions
@@ -1,3 +1,33 @@ +2001-12-03 Kiyokazu SUTO <suto@ks-and-ks.ne.jp> + + * [w3m-dev 02605] $(PWD) / allocStr() + + * XMakefile (install-scripts): use $$TOPDIR instead of $(PWD) + + * indep.c (allocStr): if len is negative, it will copy string in `s' + * display.c (record_err_message): pass -1 as length to allocStr + * etc.c (lastFileName): ditto + * etc.c (mybasename): ditto + * etc.c (FQDN): ditto + * file.c (push_tag): ditto + * func.c (addKeyList): ditto + * history.c (unshiftHist): ditto + * history.c (pushHist): ditto + * indep.c (cleanupName): ditto + * linein.c (inputLineHist): ditto + * local.c (dirBuffer): ditto + * main.c (gotoLabel): ditto + * main.c (searchKeyData): ditto + * parsetagx.c (parsedtag_set_value): ditto + * terms.c (GETSTR): ditto + * textlist.h (pushText): ditto + * url.c (DefaultFile): ditto + * url.c (parseURL): ditto + * url.c (ALLOC_STR): ditto + * url.c (parseURL2): ditto + * url.c (openURL): ditto + * w3mhelperpanel.c (extractMailcapEntry): ditto + 2001-12-02 Fumitoshi UKAI <ukai@debian.or.jp> * [w3m-dev 02604] @@ -1,4 +1,4 @@ -# $Id: XMakefile,v 1.11 2001/11/30 16:48:15 ukai Exp $ +# $Id: XMakefile,v 1.12 2001/12/02 16:26:08 ukai Exp $ SRCS=main.c file.c buffer.c display.c etc.c search.c linein.c table.c local.c \ form.c map.c frame.c rc.c menu.c mailcap.c\ func.c cookie.c history.c backend.c $(KEYBIND_SRC) @@ -107,7 +107,8 @@ all-scripts: install-scripts: all-scripts for dir in $(SCRIPTSUBDIRS); \ do \ - (cd $$dir; $(MAKE) PERL='$(PERL)' BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' DESTDIR='$(DESTDIR)' INSTALL='sh $(PWD)/install.sh' install); \ + TOPDIR=`pwd`; \ + (cd $$dir; $(MAKE) PERL='$(PERL)' BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' DESTDIR='$(DESTDIR)' INSTALL="sh $$TOPDIR/install.sh" install); \ done uninstall: @@ -1,4 +1,4 @@ -/* $Id: display.c,v 1.10 2001/11/29 09:34:14 ukai Exp $ */ +/* $Id: display.c,v 1.11 2001/12/02 16:26:08 ukai Exp $ */ #include <signal.h> #include "fm.h" @@ -782,7 +782,7 @@ record_err_message(char *s) message_list = newGeneralList(); if (message_list->nitem >= LINES) popValue(message_list); - pushValue(message_list, allocStr(s, 0)); + pushValue(message_list, allocStr(s, -1)); } } @@ -1,4 +1,4 @@ -/* $Id: etc.c,v 1.8 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: etc.c,v 1.9 2001/12/02 16:26:08 ukai Exp $ */ #include "fm.h" #include <pwd.h> #include "myctype.h" @@ -640,7 +640,7 @@ lastFileName(char *path) p++; } - return allocStr(q, 0); + return allocStr(q, -1); } #ifndef HAVE_BCOPY @@ -704,7 +704,7 @@ mybasename(char *s) p++; else p = s; - return allocStr(p, 0); + return allocStr(p, -1); } char * @@ -1518,7 +1518,7 @@ FQDN(char *host) if (!(entry = gethostbyname(host))) return NULL; - return allocStr(entry->h_name, 0); + return allocStr(entry->h_name, -1); #else /* INET6 */ for (af = ai_family_order_table[DNS_order];; af++) { int error; @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.24 2001/12/02 14:27:11 ukai Exp $ */ +/* $Id: file.c,v 1.25 2001/12/02 16:26:08 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -1675,7 +1675,7 @@ static void push_tag(struct readbuffer *obuf, char *cmdname, int cmd) { obuf->tag_stack[obuf->tag_sp] = New(struct cmdtable); - obuf->tag_stack[obuf->tag_sp]->cmdname = allocStr(cmdname, 0); + obuf->tag_stack[obuf->tag_sp]->cmdname = allocStr(cmdname, -1); obuf->tag_stack[obuf->tag_sp]->cmd = cmd; obuf->tag_sp++; if (obuf->tag_sp >= TAG_STACK_SIZE || obuf->flag & (RB_SPECIAL & ~RB_NOBR)) @@ -1,4 +1,4 @@ -/* $Id: func.c,v 1.4 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: func.c,v 1.5 2001/12/02 16:26:08 ukai Exp $ */ /* * w3m func.c */ @@ -248,7 +248,7 @@ addKeyList(KeyList *list, int key, char *data) if (data == NULL || *data == '\0') data = NULL; else - data = allocStr(data, 0); + data = allocStr(data, -1); item = searchKeyList(list, key); if (item == NULL) { if (data == NULL) @@ -1,4 +1,4 @@ -/* $Id: history.c,v 1.4 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: history.c,v 1.5 2001/12/02 16:26:08 ukai Exp $ */ #include "fm.h" #ifdef USE_HISTORY @@ -89,7 +89,7 @@ unshiftHist(Hist *hist, char *ptr) if (hist == NULL || hist->list == NULL) return NULL; - item = (HistItem *)newListItem((void *)allocStr(ptr, 0), + item = (HistItem *)newListItem((void *)allocStr(ptr, -1), (ListItem *)hist->list->first, NULL); if (hist->list->first) hist->list->first->prev = item; @@ -107,7 +107,7 @@ pushHist(Hist *hist, char *ptr) if (hist == NULL || hist->list == NULL) return NULL; - item = (HistItem *)newListItem((void *)allocStr(ptr, 0), + item = (HistItem *)newListItem((void *)allocStr(ptr, -1), NULL, (ListItem *)hist->list->last); if (hist->list->last) hist->list->last->next = item; @@ -1,4 +1,4 @@ -/* $Id: indep.c,v 1.13 2001/11/27 18:29:24 ukai Exp $ */ +/* $Id: indep.c,v 1.14 2001/12/02 16:26:08 ukai Exp $ */ #include "fm.h" #include <stdio.h> #include <pwd.h> @@ -18,7 +18,7 @@ allocStr(const char *s, int len) if (s == NULL) return NULL; - if (len == 0) + if (len < 0) len = strlen(s); ptr = NewAtom_N(char, len + 1); if (ptr == NULL) { @@ -80,7 +80,7 @@ cleanupName(char *name) { char *buf, *p, *q; - buf = allocStr(name, 0); + buf = allocStr(name, -1); p = buf; q = name; while (*q != '\0') { @@ -1,4 +1,4 @@ -/* $Id: linein.c,v 1.9 2001/11/29 09:34:14 ukai Exp $ */ +/* $Id: linein.c,v 1.10 2001/12/02 16:26:08 ukai Exp $ */ #include "fm.h" #include "local.h" #include "myctype.h" @@ -293,7 +293,7 @@ inputLineHist(char *prompt, char *def_str, int flag, Hist *hist) if (flag & IN_FILENAME) return expandName(p); else - return allocStr(p, 0); + return allocStr(p, -1); } #ifdef __EMX__ @@ -1,4 +1,4 @@ -/* $Id: local.c,v 1.10 2001/11/29 09:34:14 ukai Exp $ */ +/* $Id: local.c,v 1.11 2001/12/02 16:26:08 ukai Exp $ */ #include "fm.h" #include <string.h> #include <stdio.h> @@ -64,7 +64,7 @@ dirBuffer(char *dname) flist = New_N(char *, nfile_max); nfile = 0; while ((dir = readdir(d)) != NULL) { - flist[nfile++] = allocStr(dir->d_name, 0); + flist[nfile++] = allocStr(dir->d_name, -1); if (nfile == nfile_max) { nfile_max *= 2; flist = New_Reuse(char *, flist, nfile_max); @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.30 2001/11/30 18:06:28 ukai Exp $ */ +/* $Id: main.c,v 1.31 2001/12/02 16:26:08 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -2448,7 +2448,7 @@ gotoLabel(char *label) copyBuffer(buf, Currentbuf); for (i = 0; i < MAX_LB; i++) buf->linkBuffer[i] = NULL; - buf->currentURL.label = allocStr(label, 0); + buf->currentURL.label = allocStr(label, -1); pushHashHist(URLHist, parsedURL2Str(&buf->currentURL)->ptr); (*buf->clone)++; pushBuffer(buf); @@ -4619,17 +4619,17 @@ searchKeyData(void) KeyListItem *item; if (CurrentKeyData != NULL && *CurrentKeyData != '\0') - return allocStr(CurrentKeyData, 0); + return allocStr(CurrentKeyData, -1); #ifdef USE_MENU if (CurrentMenuData != NULL && *CurrentMenuData != '\0') - return allocStr(CurrentMenuData, 0); + return allocStr(CurrentMenuData, -1); #endif if (CurrentKey < 0) return NULL; item = searchKeyList(&w3mKeyList, CurrentKey); if (item == NULL || item->data == NULL || *item->data == '\0') return NULL; - return allocStr(item->data, 0); + return allocStr(item->data, -1); } static int diff --git a/parsetagx.c b/parsetagx.c index dfacdce..08b3f8e 100644 --- a/parsetagx.c +++ b/parsetagx.c @@ -1,4 +1,4 @@ -/* $Id: parsetagx.c,v 1.6 2001/11/29 09:34:15 ukai Exp $ */ +/* $Id: parsetagx.c,v 1.7 2001/12/02 16:26:08 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "indep.h" @@ -232,7 +232,7 @@ parsedtag_set_value(struct parsed_tag *tag, int id, char *value) i = tag->map[id]; tag->attrid[i] = id; if (value) - tag->value[i] = allocStr(value, 0); + tag->value[i] = allocStr(value, -1); else tag->value[i] = NULL; tag->need_reconstruct = TRUE; @@ -1,4 +1,4 @@ -/* $Id: terms.c,v 1.19 2001/11/30 10:10:24 ukai Exp $ */ +/* $Id: terms.c,v 1.20 2001/12/02 16:26:08 ukai Exp $ */ /* * An original curses library for EUC-kanji by Akinori ITO, December 1989 * revised by Akinori ITO, January 1995 @@ -577,7 +577,7 @@ setgraphchar(void) #define graphchar(c) (((unsigned)(c)>=' ' && (unsigned)(c)<128)? gcmap[(c)-' '] : (c)) -#define GETSTR(v,s) {v = pt; suc = tgetstr(s,&pt); if (!suc) v = ""; else v = allocStr(suc,0); } +#define GETSTR(v,s) {v = pt; suc = tgetstr(s,&pt); if (!suc) v = ""; else v = allocStr(suc, -1); } void getTCstr(void) @@ -1,4 +1,4 @@ -/* $Id: textlist.h,v 1.3 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: textlist.h,v 1.4 2001/12/02 16:26:08 ukai Exp $ */ #ifndef TEXTLIST_H #define TEXTLIST_H #include "Str.h" @@ -39,7 +39,7 @@ typedef struct _textlist { } TextList; #define newTextList() ((TextList *)newGeneralList()) -#define pushText(tl, s) pushValue((GeneralList *)(tl), (void *)allocStr((s)?(s):"",0)) +#define pushText(tl, s) pushValue((GeneralList *)(tl), (void *)allocStr((s)?(s):"",-1)) #define popText(tl) ((char *)popValue((GeneralList *)(tl))) #define rpopText(tl) ((char *)rpopValue((GeneralList *)(tl))) #define appendTextList(tl, tl2) ((TextList *)appendGeneralList((GeneralList *)(tl), (GeneralList *)(tl2))) @@ -1,4 +1,4 @@ -/* $Id: url.c,v 1.16 2001/11/30 14:06:27 ukai Exp $ */ +/* $Id: url.c,v 1.17 2001/12/02 16:26:08 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include <sys/socket.h> @@ -212,15 +212,15 @@ DefaultFile(int scheme) #ifdef USE_SSL case SCM_HTTPS: #endif /* USE_SSL */ - return allocStr(HTTP_DEFAULT_FILE, 0); + return allocStr(HTTP_DEFAULT_FILE, -1); #ifdef USE_GOPHER case SCM_GOPHER: - return allocStr("1", 0); + return allocStr("1", -1); #endif /* USE_GOPHER */ case SCM_LOCAL: case SCM_LOCAL_CGI: case SCM_FTP: - return allocStr("/", 0); + return allocStr("/", -1); } return NULL; } @@ -830,7 +830,7 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current) q++; if (IS_ALPHA(q[0]) && (q[1] == ':' || q[1] == '|')) { if (q[1] == '|') { - p = allocStr(q, 0); + p = allocStr(q, -1); p[1] = ':'; } else @@ -914,17 +914,17 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current) do_label: if (p_url->scheme == SCM_MISSING) { p_url->scheme = SCM_LOCAL; - p_url->file = allocStr(p, 0); + p_url->file = allocStr(p, -1); p_url->label = NULL; } else if (*p == '#') - p_url->label = allocStr(p + 1, 0); + p_url->label = allocStr(p + 1, -1); else p_url->label = NULL; } #define initParsedURL(p) bzero(p,sizeof(ParsedURL)) -#define ALLOC_STR(s) ((s)==NULL?NULL:allocStr(s,0)) +#define ALLOC_STR(s) ((s)==NULL?NULL:allocStr(s,-1)) void copyParsedURL(ParsedURL *p, ParsedURL *q) @@ -997,7 +997,7 @@ parseURL2(char *url, ParsedURL *pu, ParsedURL *current) #ifdef USE_GOPHER else if (pu->scheme == SCM_GOPHER && pu->file[0] == '/') { p = pu->file; - pu->file = allocStr(p + 1, 0); + pu->file = allocStr(p + 1, -1); } #endif /* USE_GOPHER */ } @@ -1485,7 +1485,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, return uf; case SCM_FTP: if (pu->file == NULL) - pu->file = allocStr("/", 0); + pu->file = allocStr("/", -1); if (non_null(FTP_proxy) && !Do_not_use_proxy && pu->host != NULL && !check_no_proxy(pu->host)) { @@ -1509,7 +1509,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, case SCM_HTTPS: #endif /* USE_SSL */ if (pu->file == NULL) - pu->file = allocStr("/", 0); + pu->file = allocStr("/", -1); if (request && request->method == FORM_METHOD_POST && request->body) hr.command = HR_COMMAND_POST; if (request && request->method == FORM_METHOD_HEAD) diff --git a/w3mhelperpanel.c b/w3mhelperpanel.c index 6186a61..87c602f 100644 --- a/w3mhelperpanel.c +++ b/w3mhelperpanel.c @@ -1,4 +1,4 @@ -/* $Id: w3mhelperpanel.c,v 1.6 2001/11/24 02:01:26 ukai Exp $ */ +/* $Id: w3mhelperpanel.c,v 1.7 2001/12/02 16:26:08 ukai Exp $ */ #include <errno.h> #include <stdlib.h> #include <stdio.h> @@ -46,7 +46,7 @@ extractMailcapEntry(char *mcap_entry, char **type, char **cmd) j++; while (mcap_entry[j] && IS_SPACE(mcap_entry[j])) j++; - *cmd = allocStr(&mcap_entry[j], 0); + *cmd = allocStr(&mcap_entry[j], -1); } static void |