Small bugfixes, killing of debuging hacks that escaped me.

This commit is contained in:
Pavel Machek 1998-11-22 16:17:42 +00:00
parent ae099afa17
commit 4029fef2f3
5 changed files with 26 additions and 10 deletions

View File

@ -1,3 +1,13 @@
Sat Nov 21 21:38:08 1998 Pavel Machek <pavel@bug.ucw.cz>
* vfs.c (vfs_parse_ls_lga): corrected stupid bug in parse_ls_lga,
thanks to Pavel Roskin for reporting
* direntry.c (vfs_s_lseek): -1 is invalid filehandle, not 0
* utilvfs.c (vfs_split_url): initialize variables so that we do
not return garbage
Sat Nov 7 20:19:14 1998 Pavel Machek <pavel@bug.ucw.cz>
* vfs.c: Converted g_return_if_fail into vfs_dies(), removed them

View File

@ -102,14 +102,18 @@ VFSSOOBJS = tcputil.so fish.so ftpfs.so mcfs.so utilvfs.so local.so vfs.so \
util.sor utilunix.sor direntry.so
%.sor: ../src/%.c
$(CC) -fpic -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DVFS_STANDALONE $< -o $@
$(CC) -fpic -Wall -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DVFS_STANDALONE $< -o $@
%.so: %.c
$(CC) -fpic -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DVFS_STANDALONE $< -o $@
$(CC) -fpic -Wall -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DVFS_STANDALONE $< -o $@
libvfs.so: $(VFSSOOBJS)
gcc $(VFSSOOBJS) -shared -o libvfs.so
libvfs.a: $(VFSSOOBJS)
$(RMF) $@
$(AR) cr $@ $(VFSSOOBJS)
-$(RANLIB) $@
Makefile: $(srcdir)/Make-mc.in $(builddir)/config.status
cd $(builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -159,7 +163,7 @@ TAGS: $(VFSSRCS)
etags $(VFSSRCS)
clean:
$(RMF) mcserv *.o core a.out libvfs-mc.a mcservx *.so *.sor
$(RMF) mcserv *.o core a.out *.a mcservx *.so *.sor
realclean: clean
$(RMF) .depend

View File

@ -750,7 +750,7 @@ int vfs_s_lseek (void *fh, off_t offset, int whence)
{
off_t size = FH->ino->st.st_size;
if (FH->handle) { /* If we have local file opened, we want to work with it */
if (FH->handle != -1) { /* If we have local file opened, we want to work with it */
int retval = lseek(FH->handle, offset, whence);
if (retval == -1)
FH->ino->super->me->verrno = errno;

View File

@ -72,9 +72,10 @@ char *vfs_split_url (char *path, char **host, char **user, int *port, char **pas
*pass = NULL;
*port = default_port;
*user = NULL;
retval = NULL;
dir = pcopy;
if (!flags & URL_NOSLASH) {
if (!(flags & URL_NOSLASH)) {
/* locate path component */
for (; *dir != '/' && *dir; dir++)
;

View File

@ -475,8 +475,6 @@ mc_opendir (char *dirname)
char *p = NULL;
int i = strlen (dirname);
message_1s(1, " Opening ", dirname );
if (dirname [i - 1] != '/'){
/* We should make possible reading of the root directory in a tar file */
p = xmalloc (i + 2, "slash");
@ -1486,7 +1484,7 @@ vfs_parse_ls_lga (char *p, struct stat *s, char **filename, char **linkname)
if (strncmp (p, "total", 5) == 0)
return 0;
p_copy = strdup (p);
p_copy = strdup(p);
if ((i = vfs_parse_filetype(*(p++))) == -1)
goto error;
@ -1506,7 +1504,9 @@ vfs_parse_ls_lga (char *p, struct stat *s, char **filename, char **linkname)
s->st_mode |= i;
p += 9;
}
free(p_copy);
p_copy = strdup(p);
num_cols = vfs_split_text (p);
s->st_nlink = atol (columns [0]);
@ -1644,7 +1644,8 @@ vfs_parse_ls_lga (char *p, struct stat *s, char **filename, char **linkname)
error:
message_1s (1, "Could not parse:", p_copy);
free (p_copy);
if (p_copy != p) /* Carefull! */
free (p_copy);
return 0;
}