summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-04-08 02:19:34 +0200
committerDan McGee <dan@archlinux.org>2008-04-08 02:19:34 +0200
commit83c4b2aebbb7d2a71eecc672987deca1d4846f0b (patch)
tree95a2bf5d0e2763e6f810f0470905230f3f78fb54 /src
parenta708c6eadc107475015eb2fbe2c7ec5d00bc0099 (diff)
parentbec2ba5b4005053ce8f7048fa825ed58e3adfdc2 (diff)
downloadpacman-83c4b2aebbb7d2a71eecc672987deca1d4846f0b.tar.gz
pacman-83c4b2aebbb7d2a71eecc672987deca1d4846f0b.tar.xz
Merge branch 'maint'
Diffstat (limited to 'src')
-rw-r--r--src/pacman/.gitignore1
-rw-r--r--src/pacman/callback.c10
-rw-r--r--src/util/.gitignore3
3 files changed, 14 insertions, 0 deletions
diff --git a/src/pacman/.gitignore b/src/pacman/.gitignore
index 3b2600fd..61407057 100644
--- a/src/pacman/.gitignore
+++ b/src/pacman/.gitignore
@@ -1,4 +1,5 @@
.deps
.libs
pacman
+pacman.exe
pacman.static
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 47b538e5..8a7af5c5 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -361,7 +361,17 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
len = strlen(opr) + ((pkgname) ? strlen(pkgname) : 0) + 2;
wcstr = calloc(len, sizeof(wchar_t));
/* print our strings to the alloc'ed memory */
+#if defined(HAVE_SWPRINTF)
wclen = swprintf(wcstr, len, L"%s %s", opr, pkgname);
+#else
+ /* because the format string was simple, we can easily do this without
+ * using swprintf, although it is probably not as safe/fast. The max
+ * chars we can copy is decremented each time by subtracting the length
+ * of the already printed/copied wide char string. */
+ wclen = mbstowcs(wcstr, opr, len);
+ wclen += mbstowcs(wcstr + wclen, " ", len - wclen);
+ wclen += mbstowcs(wcstr + wclen, pkgname, len - wclen);
+#endif
wcwid = wcswidth(wcstr, wclen);
padwid = textlen - wcwid;
/* if padwid is < 0, we need to trim the string so padwid = 0 */
diff --git a/src/util/.gitignore b/src/util/.gitignore
index 36688806..c85ea2ca 100644
--- a/src/util/.gitignore
+++ b/src/util/.gitignore
@@ -1,5 +1,8 @@
.deps
.libs
vercmp
+vercmp.exe
testpkg
+testpkg.exe
testdb
+testdb.exe