len = strlen(ua->argk[0]);
for (i=0; i<comsize; i++) { /* search for command */
- if (strncasecmp(ua->argk[0], _(commands[i].key), len) == 0) {
+ if (strncasecmp(ua->argk[0], commands[i].key, len) == 0) {
/* Check if command permitted, but "quit" is always OK */
- if (strcmp(ua->argk[0], "quit") != 0 &&
+ if (strcmp(ua->argk[0], NT_("quit")) != 0 &&
!acl_access_ok(ua, Command_ACL, ua->argk[0], len)) {
break;
}
void set_pool_dbr_defaults_in_media_dbr(MEDIA_DBR *mr, POOL_DBR *pr)
{
mr->PoolId = pr->PoolId;
- bstrncpy(mr->VolStatus, "Append", sizeof(mr->VolStatus));
+ bstrncpy(mr->VolStatus, NT_("Append"), sizeof(mr->VolStatus));
mr->Recycle = pr->Recycle;
mr->VolRetention = pr->VolRetention;
mr->VolUseDuration = pr->VolUseDuration;
onoff = ua->argk[1];
}
- ua->automount = (strcasecmp(onoff, _("off")) == 0) ? 0 : 1;
+ ua->automount = (strcasecmp(onoff, NT_("off")) == 0) ? 0 : 1;
return 1;
}
}
for (i=1; i<ua->argc; i++) {
- if (strcasecmp(ua->argk[i], _("jobid")) == 0) {
+ if (strcasecmp(ua->argk[i], NT_("jobid")) == 0) {
uint32_t JobId;
if (!ua->argv[i]) {
break;
return 1;
}
break;
- } else if (strcasecmp(ua->argk[i], _("job")) == 0) {
+ } else if (strcasecmp(ua->argk[i], NT_("job")) == 0) {
if (!ua->argv[i]) {
break;
}
bstrncpy(jcr->Job, ua->argv[i], sizeof(jcr->Job));
}
break;
- } else if (strcasecmp(ua->argk[i], _("ujobid")) == 0) {
+ } else if (strcasecmp(ua->argk[i], NT_("ujobid")) == 0) {
if (!ua->argv[i]) {
break;
}
*/
static int python_cmd(UAContext *ua, const char *cmd)
{
- if (ua->argc >= 1 && strcasecmp(ua->argk[1], _("restart")) == 0) {
+ if (ua->argc >= 1 && strcasecmp(ua->argk[1], NT_("restart")) == 0) {
term_python_interpreter();
init_python_interpreter(director->hdr.name,
director->scripts_directory, "DirStartUp");
}
}
- if (strcasecmp(ua->argk[i], "store") == 0 ||
- strcasecmp(ua->argk[i], "storage") == 0 ||
- strcasecmp(ua->argk[i], "sd") == 0) {
+ if (strcasecmp(ua->argk[i], NT_("store")) == 0 ||
+ strcasecmp(ua->argk[i], NT_("storage")) == 0 ||
+ strcasecmp(ua->argk[i], NT_("sd")) == 0) {
store = NULL;
if (ua->argv[i]) {
store = (STORE *)GetResWithName(R_STORAGE, ua->argv[i]);
* prompt the user.
*/
start_prompt(ua, _("Available daemons are: \n"));
- add_prompt(ua, "Director");
- add_prompt(ua, "Storage");
- add_prompt(ua, "Client");
- add_prompt(ua, "All");
+ add_prompt(ua, _("Director"));
+ add_prompt(ua, _("Storage"));
+ add_prompt(ua, _("Client"));
+ add_prompt(ua, _("All"));
switch(do_prompt(ua, "", _("Select daemon type to set debug level"), NULL, 0)) {
case 0: /* Director */
debug_level = level;
onoff = ua->argk[1];
}
- set_trace((strcasecmp(onoff, _("off")) == 0) ? false : true);
+ set_trace((strcasecmp(onoff, NT_("off")) == 0) ? false : true);
return 1;
}
jcr->JobLevel = L_FULL;
for (int i=1; i<ua->argc; i++) {
- if (strcasecmp(ua->argk[i], "client") == 0 ||
- strcasecmp(ua->argk[i], "fd") == 0) {
+ if (strcasecmp(ua->argk[i], NT_("client")) == 0 ||
+ strcasecmp(ua->argk[i], NT_("fd")) == 0) {
if (ua->argv[i]) {
client = (CLIENT *)GetResWithName(R_CLIENT, ua->argv[i]);
continue;
}
}
- if (strcasecmp(ua->argk[i], "job") == 0) {
+ if (strcasecmp(ua->argk[i], NT_("job")) == 0) {
if (ua->argv[i]) {
job = (JOB *)GetResWithName(R_JOB, ua->argv[i]);
continue;
}
}
- if (strcasecmp(ua->argk[i], "fileset") == 0) {
+ if (strcasecmp(ua->argk[i], NT_("fileset")) == 0) {
if (ua->argv[i]) {
fileset = (FILESET *)GetResWithName(R_FILESET, ua->argv[i]);
continue;
}
}
- if (strcasecmp(ua->argk[i], "listing") == 0) {
+ if (strcasecmp(ua->argk[i], NT_("listing")) == 0) {
listing = 1;
continue;
}
- if (strcasecmp(ua->argk[i], "level") == 0) {
+ if (strcasecmp(ua->argk[i], NT_("level")) == 0) {
if (!get_level_from_name(ua->jcr, ua->argv[i])) {
bsendmsg(ua, _("Level %s not valid.\n"), ua->argv[i]);
}
unsigned int i;
for (i=0; i<comsize; i++) {
- bsendmsg(ua, "%s %s\n", _(commands[i].key), _(commands[i].help));
+ bsendmsg(ua, "%s %s\n", commands[i].key, _(commands[i].help));
}
return 1;
}
*/
static int separate_path_and_file(JCR *jcr, char *fname, char *ofile)
{
- char *f, *p;
+ char *f, *p, *q;
int fnl, pnl;
/* Separate pathname and filename */
- for (p=f=ofile; *p; p++) {
+ for (q=p=f=ofile; *p; p++) {
if (*p == '/') {
- f = p; /* possible filename */
+ f = q; /* possible filename */
}
+#ifdef HAVE_WIN32
+ if (*p == '\\') { /* strip backslashes on Win32 */
+ continue;
+ }
+ *q++ = *p; /* copy data */
+#else
+ q++;
+#endif
}
+
if (*f == '/') {
f++;
}
+ *q = 0; /* terminate string */
- fnl = p - f;
+ fnl = q - f;
if (fnl == 0) {
/* The filename length must not be zero here because we
* are dealing with a file (i.e. FT_REGE or FT_REG).
*/
- Qmsg1(jcr, M_ERROR, 0, _("Zero length filename: %s\n"), fname);
+ Jmsg1(jcr, M_ERROR, 0, _("Zero length filename: %s\n"), fname);
return -1;
}
pnl = f - ofile - 1;
if (jcr->cached_pnl == pnl && strcmp(path, jcr->cached_path) == 0) {
return 1;
}
- pm_strcpy(&jcr->cached_path, path);
+ pm_strcpy(jcr->cached_path, path);
jcr->cached_pnl = pnl;
return 0;
}
#-----------------------------------------------------
-# What flavor of GCC cross-compiler are we building?
-
+# Directory where cross-tools directory will be placed
+TOPDIR=../../..
+# Cross tools directory name under TOPDIR
+CROSSTOOLS=cross-tools
+# What flavor of GCC cross-compiler are we building? under CROSSTOOLS
TARGET=mingw32
-# What directory will the cross-compiler be built in?
-# This is the directory into which source archives will
-# be downloaded, expanded, compiled, etc. You need to
-# have write-access to this directory. If you leave it
-# blank, it defaults to the current directory.
-
-#BUILDDIR=/data/cross-tools-4.1.0
-BUILDDIR=../../../mingw
cwd=`pwd`
-cd ${BUILDDIR}
-# Now make builddir absolute
-BUILDDIR=`pwd`
-cd ${cwd}
+cd ${TOPDIR}
+# Make TOPDIR absolute
+TOPDIR=`pwd`
+BUILDDIR=${TOPDIR}/${CROSSTOOLS}
-mkdir -p ${BUILDDIR}
-mkdir -p ${BUILDDIR}/${TARGET}
+cd ${cwd}
# Where does the cross-compiler go?
# This should be the directory into which your cross-compiler
# that only root has write access to, you will need to run this
# script as root.
-PREFIX=${BUILDDIR}/mingw32
+PREFIX=${BUILDDIR}/${TARGET}
+mkdir -p ${BUILDDIR}
+mkdir -p ${BUILDDIR}/${TARGET}
# Purge anything and everything already in the $PREFIX
#(also known as the destination or installation) directory?