mirror of
https://github.com/JotaRandom/hfsutils.git
synced 2024-06-02 22:41:29 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
263327c7cd | ||
|
e62ea3c5ac | ||
|
b6df6a4599 | ||
|
45b8c14fd1 | ||
|
81a6c106d4 | ||
|
ca2d077127 |
|
@ -36,7 +36,7 @@ INCDEST = @includedir@
|
|||
|
||||
MANEXT = 1
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL = @INSTALL@ -D
|
||||
BININSTALL = @INSTALL_PROGRAM@ -m 755
|
||||
LIBINSTALL = @INSTALL_DATA@
|
||||
HARDLINK = ln -f
|
||||
|
@ -111,7 +111,7 @@ check :: all
|
|||
install :: @INSTALL_TARGETS@
|
||||
|
||||
install_cli :: all_cli
|
||||
$(BININSTALL) $(HFSUTIL) "$(BINDEST)/."
|
||||
$(BININSTALL) $(HFSUTIL) "$(BINDEST)/$(HFSUTIL)"
|
||||
|
||||
for file in $(CLITARGETS); do \
|
||||
$(HARDLINK) "$(BINDEST)/$(HFSUTIL)" "$(BINDEST)/$$file"; \
|
||||
|
@ -126,7 +126,7 @@ install_cli :: all_cli
|
|||
|
||||
install_tcl :: all_tcl
|
||||
for file in $(TCLTARGETS); do \
|
||||
$(BININSTALL) $$file "$(BINDEST)/."; \
|
||||
$(BININSTALL) $$file "$(BINDEST)/$$file"; \
|
||||
done
|
||||
|
||||
if [ -f "$(BINDEST)/hfs" ]; then \
|
||||
|
@ -142,7 +142,7 @@ install_tcl :: all_tcl
|
|||
|
||||
install_tk :: all_tk
|
||||
for file in $(TKTARGETS); do \
|
||||
$(BININSTALL) $$file "$(BINDEST)/."; \
|
||||
$(BININSTALL) $$file "$(BINDEST)/$(TKTARGETS)"; \
|
||||
done
|
||||
|
||||
for file in $(TKDOCS); do \
|
||||
|
|
|
@ -91,3 +91,5 @@ char *strstr(const char *, const char *);
|
|||
# ifndef HAVE_STRTOL
|
||||
long strtol(const char *, char **, int);
|
||||
# endif
|
||||
|
||||
#define USE_INTERP_RESULT 1
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
* $Id: unix.c,v 1.8 1998/11/02 22:09:13 rob Exp $
|
||||
*/
|
||||
|
||||
#ifdef __linux__
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#define _LARGE_FILES
|
||||
#endif
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
|
33
tclhfs.c
33
tclhfs.c
|
@ -43,8 +43,7 @@
|
|||
# include "charset.h"
|
||||
# include "suid.h"
|
||||
# include "version.h"
|
||||
|
||||
extern int errno;
|
||||
# include <errno.h>
|
||||
|
||||
# define ERROR(code, str) (hfs_error = (str), errno = (code))
|
||||
|
||||
|
@ -228,7 +227,7 @@ int getdir(Tcl_Interp *interp, volref *vref, const char *path)
|
|||
|
||||
Tcl_AppendElement(interp, str);
|
||||
|
||||
free(str);
|
||||
Tcl_Free(str);
|
||||
}
|
||||
|
||||
if (hfs_closedir(dir) == -1)
|
||||
|
@ -245,7 +244,7 @@ int getdir(Tcl_Interp *interp, volref *vref, const char *path)
|
|||
|
||||
Tcl_AppendElement(interp, str);
|
||||
|
||||
free(str);
|
||||
Tcl_Free(str);
|
||||
}
|
||||
|
||||
return TCL_OK;
|
||||
|
@ -379,17 +378,12 @@ int file_cmd(ClientData clientData, Tcl_Interp *interp,
|
|||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
mem = ALLOC(char, bytes + 1);
|
||||
if (mem == 0)
|
||||
{
|
||||
interp->result = "out of memory";
|
||||
return TCL_ERROR;
|
||||
}
|
||||
mem = Tcl_Alloc(bytes + 1);
|
||||
|
||||
bytes = hfs_read(file, mem, bytes);
|
||||
if (bytes == -1)
|
||||
{
|
||||
free(mem);
|
||||
Tcl_Free(mem);
|
||||
return error(interp, 0);
|
||||
}
|
||||
|
||||
|
@ -903,7 +897,7 @@ int vol_cmd(ClientData clientData, Tcl_Interp *interp,
|
|||
}
|
||||
|
||||
result = Tcl_Merge(listc, listv);
|
||||
free(listv);
|
||||
Tcl_Free(listv);
|
||||
|
||||
Tcl_SetResult(interp, result, TCL_DYNAMIC);
|
||||
}
|
||||
|
@ -1048,7 +1042,7 @@ int vol_cmd(ClientData clientData, Tcl_Interp *interp,
|
|||
}
|
||||
|
||||
result = Tcl_Merge(fargc, fargv);
|
||||
free(fargv);
|
||||
Tcl_Free(fargv);
|
||||
|
||||
Tcl_SetResult(interp, result, TCL_DYNAMIC);
|
||||
}
|
||||
|
@ -1314,7 +1308,7 @@ int cmd_hfs(ClientData clientData, Tcl_Interp *interp,
|
|||
badblocks = ALLOCX(unsigned long, listc);
|
||||
if (listc && badblocks == 0)
|
||||
{
|
||||
free(listv);
|
||||
Tcl_Free(listv);
|
||||
|
||||
interp->result = "out of memory";
|
||||
return TCL_ERROR;
|
||||
|
@ -1325,13 +1319,13 @@ int cmd_hfs(ClientData clientData, Tcl_Interp *interp,
|
|||
if (Tcl_ExprLong(interp, listv[i],
|
||||
(long *) &badblocks[i]) != TCL_OK)
|
||||
{
|
||||
free(listv);
|
||||
Tcl_Free(listv);
|
||||
FREE(badblocks);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
free(listv);
|
||||
Tcl_Free(listv);
|
||||
|
||||
if (do_format(argv[2], partno, 0, argv[4], listc, badblocks) == -1)
|
||||
{
|
||||
|
@ -1353,6 +1347,7 @@ int cmd_hfs(ClientData clientData, Tcl_Interp *interp,
|
|||
else if (strcmp(argv[1], "chartrans") == 0)
|
||||
{
|
||||
char *result;
|
||||
char *tclresult;
|
||||
|
||||
if (argc != 5)
|
||||
{
|
||||
|
@ -1388,7 +1383,11 @@ int cmd_hfs(ClientData clientData, Tcl_Interp *interp,
|
|||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
Tcl_SetResult(interp, result, TCL_DYNAMIC);
|
||||
tclresult = Tcl_Alloc(strlen(result) + 1);
|
||||
memcpy(tclresult, result, strlen(result) + 1);
|
||||
free(result);
|
||||
|
||||
Tcl_SetResult(interp, tclresult, TCL_DYNAMIC);
|
||||
}
|
||||
else if (strcmp(argv[1], "version") == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user